See discussion in issue: https://github.com/sqlalchemy/alembic/issues/1011
### Description
Summary of changes:
* updated `alembic.ini` templates
* updated tutorial accordingly
### Checklist
This pull request is:
- [x] A documentation / typographical error fix
- [ ] A short code fix
- [ ] A new feature implementation
Closes: #1013
Pull-request: https://github.com/sqlalchemy/alembic/pull/1013
Pull-request-sha:
34f06ac0a59a6207cf132f9ae5fdc9bc4780f404
Change-Id: Ia51441c9ec39a43a0ecc1270a40859af014b326c
# path to migration scripts
script_location = ${script_location}
-# template used to generate migration files
-# file_template = %%(rev)s_%%(slug)s
+# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+# Uncomment the line below if you want the files to be prepended with date and time
+# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
# path to migration scripts
script_location = ${script_location}
-# template used to generate migration files
-# file_template = %%(rev)s_%%(slug)s
+# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+# Uncomment the line below if you want the files to be prepended with date and time
+# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
# path to migration scripts
script_location = ${script_location}
-# template used to generate migration files
-# file_template = %%(rev)s_%%(slug)s
+# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+# Uncomment the line below if you want the files to be prepended with date and time
+# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
# path to migration scripts
script_location = ${script_location}
-# template used to generate migration files
-# file_template = %%(rev)s_%%(slug)s
+# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+# Uncomment the line below if you want the files to be prepended with date and time
+# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
# path to migration scripts
script_location = alembic
- # template used to generate migration files
- # file_template = %%(rev)s_%%(slug)s
+ # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+ # Uncomment the line below if you want the files to be prepended with date and time
+ # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
URI which contains colons is interpreted here as a resource name, rather than
a straight filename.
-* ``file_template`` - this is the naming scheme used to generate new migration files.
- The value present is the default, so is commented out. Tokens available include:
+* ``file_template`` - this is the naming scheme used to generate new migration
+ files. Uncomment the presented value if you would like the migration files to
+ be prepended with date and time, so that they are listed in chronological
+ order. The default value is ``%%(rev)s_%%(slug)s``. Tokens available
+ include:
* ``%%(rev)s`` - revision id
* ``%%(slug)s`` - a truncated string derived from the revision message