]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Fix bug with minute component in file_template and make sure it is tested correctly
authorDaniel Haaker <d.haaker@gmail.com>
Sat, 20 Oct 2012 22:08:58 +0000 (00:08 +0200)
committerDaniel Haaker <d.haaker@gmail.com>
Sat, 20 Oct 2012 22:08:58 +0000 (00:08 +0200)
CHANGES
alembic/script.py
tests/test_revision_create.py

diff --git a/CHANGES b/CHANGES
index 9d551ecd216892b870f5560d6494adb21952a857..8e7ab6bfe44ad4928bbdaa7ceb6a09efe8f238f7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@
   from operations.create_table() documentation.
   #81
 
+- [bug] Fixed the minute component in file_template
+  which returned the month part of the create date.
+
 0.4.0
 =====
 - [feature] Support for tables in alternate schemas
index b411fb9775f36953725ec0ed320c41fbb2cc68ec..68d266ea7779fd063fdde7dc139715cfdadd7e0e 100644 (file)
@@ -227,7 +227,7 @@ class ScriptDirectory(object):
                 'month': create_date.month,
                 'day': create_date.day,
                 'hour': create_date.hour,
-                'minute': create_date.month,
+                'minute': create_date.minute,
                 'second': create_date.second
             }
         )
index 78a628a29c6d749df3bf8214b555b9eba144b6d8..fd9a7ed74aeb4eb06e52a7491a94df1657479031 100644 (file)
@@ -105,11 +105,11 @@ class ScriptNamingTest(unittest.TestCase):
                             "%(day)s_%(hour)s_"
                             "%(minute)s_%(second)s"
                     )
-        create_date = datetime.datetime(2012, 5, 25, 15, 8, 5)
+        create_date = datetime.datetime(2012, 7, 25, 15, 8, 5)
         eq_(
             script._rev_path("12345", "this is a message", create_date),
             "%s/versions/12345_this_is_a_"
-            "message_2012_5_25_15_5_5.py" % staging_directory
+            "message_2012_7_25_15_8_5.py" % staging_directory
         )