edccf8a
diff -up sqlalchemy-migrate-0.7.2/migrate/tests/fixture/shell.py.rename sqlalchemy-migrate-0.7.2/migrate/tests/fixture/shell.py
edccf8a
--- sqlalchemy-migrate-0.7.2/migrate/tests/fixture/shell.py.rename	2011-11-08 15:53:44.296081010 +0100
edccf8a
+++ sqlalchemy-migrate-0.7.2/migrate/tests/fixture/shell.py	2011-11-08 15:53:44.301081040 +0100
5613a61
@@ -25,9 +25,9 @@ class Shell(Pathed):
5613a61
         )
5613a61
 
5613a61
     def run_version(self, repos_path):
5613a61
-        result = self.env.run('migrate version %s' % repos_path)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s' % repos_path)
5613a61
         return int(result.stdout.strip())
5613a61
 
5613a61
     def run_db_version(self, url, repos_path):
5613a61
-        result = self.env.run('migrate db_version %s %s' % (url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate db_version %s %s' % (url, repos_path))
5613a61
         return int(result.stdout.strip())
edccf8a
diff -up sqlalchemy-migrate-0.7.2/migrate/tests/versioning/test_shell.py.rename sqlalchemy-migrate-0.7.2/migrate/tests/versioning/test_shell.py
edccf8a
--- sqlalchemy-migrate-0.7.2/migrate/tests/versioning/test_shell.py.rename	2011-11-08 15:53:44.298081022 +0100
edccf8a
+++ sqlalchemy-migrate-0.7.2/migrate/tests/versioning/test_shell.py	2011-11-08 16:01:22.408916690 +0100
2edd588
@@ -21,15 +21,15 @@ class TestShellCommands(Shell):
5613a61
 
5613a61
     def test_help(self):
5613a61
         """Displays default help dialog"""
5613a61
-        self.assertEqual(self.env.run('migrate -h').returncode, 0)
5613a61
-        self.assertEqual(self.env.run('migrate --help').returncode, 0)
5613a61
-        self.assertEqual(self.env.run('migrate help').returncode, 0)
5613a61
+        self.assertEqual(self.env.run('sqlalchemy-migrate -h').returncode, 0)
5613a61
+        self.assertEqual(self.env.run('sqlalchemy-migrate --help').returncode, 0)
5613a61
+        self.assertEqual(self.env.run('sqlalchemy-migrate help').returncode, 0)
5613a61
 
5613a61
     def test_help_commands(self):
5613a61
         """Display help on a specific command"""
5613a61
         # we can only test that we get some output
5613a61
         for cmd in api.__all__:
5613a61
-            result = self.env.run('migrate help %s' % cmd)
5613a61
+            result = self.env.run('sqlalchemy-migrate help %s' % cmd)
5613a61
             self.assertTrue(isinstance(result.stdout, basestring))
5613a61
             self.assertTrue(result.stdout)
5613a61
             self.assertFalse(result.stderr)
2edd588
@@ -37,10 +37,10 @@ class TestShellCommands(Shell):
5613a61
     def test_shutdown_logging(self):
5613a61
         """Try to shutdown logging output"""
5613a61
         repos = self.tmp_repos()
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos)
5613a61
-        result = self.env.run('migrate version %s --disable_logging' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s --disable_logging' % repos)
5613a61
         self.assertEqual(result.stdout, '')
5613a61
-        result = self.env.run('migrate version %s -q' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s -q' % repos)
5613a61
         self.assertEqual(result.stdout, '')
5613a61
 
5613a61
         # TODO: assert logging messages to 0
2edd588
@@ -94,7 +94,7 @@ class TestShellCommands(Shell):
5613a61
         repos = self.tmp_repos()
5613a61
 
5613a61
         # Creating a file that doesn't exist should succeed
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos)
5613a61
 
5613a61
         # Files should actually be created
5613a61
         self.assert_(os.path.exists(repos))
2edd588
@@ -104,35 +104,35 @@ class TestShellCommands(Shell):
5613a61
         self.assertNotEquals(repos_.config.get('db_settings', 'version_table'), 'None')
5613a61
 
5613a61
         # Can't create it again: it already exists
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos,
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos,
5613a61
             expect_error=True)
5613a61
         self.assertEqual(result.returncode, 2)
5613a61
     
5613a61
     def test_script(self):
5613a61
         """We can create a migration script via the command line"""
5613a61
         repos = self.tmp_repos()
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos)
5613a61
 
5613a61
-        result = self.env.run('migrate script --repository=%s Desc' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate script --repository=%s Desc' % repos)
5613a61
         self.assert_(os.path.exists('%s/versions/001_Desc.py' % repos))
5613a61
 
5613a61
-        result = self.env.run('migrate script More %s' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate script More %s' % repos)
5613a61
         self.assert_(os.path.exists('%s/versions/002_More.py' % repos))
5613a61
 
5613a61
-        result = self.env.run('migrate script "Some Random name" %s' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate script "Some Random name" %s' % repos)
5613a61
         self.assert_(os.path.exists('%s/versions/003_Some_Random_name.py' % repos))
5613a61
 
5613a61
     def test_script_sql(self):
5613a61
         """We can create a migration sql script via the command line"""
5613a61
         repos = self.tmp_repos()
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos)
5613a61
 
edccf8a
-        result = self.env.run('migrate script_sql mydb foo %s' % repos)
edccf8a
+        result = self.env.run('sqlalchemy-migrate script_sql mydb foo %s' % repos)
edccf8a
         self.assert_(os.path.exists('%s/versions/001_foo_mydb_upgrade.sql' % repos))
edccf8a
         self.assert_(os.path.exists('%s/versions/001_foo_mydb_downgrade.sql' % repos))
5613a61
 
5613a61
         # Test creating a second
edccf8a
-        result = self.env.run('migrate script_sql postgres foo --repository=%s' % repos)
edccf8a
+        result = self.env.run('sqlalchemy-migrate script_sql postgres foo --repository=%s' % repos)
edccf8a
         self.assert_(os.path.exists('%s/versions/002_foo_postgres_upgrade.sql' % repos))
edccf8a
         self.assert_(os.path.exists('%s/versions/002_foo_postgres_downgrade.sql' % repos))
5613a61
 
2edd588
@@ -144,7 +144,7 @@ class TestShellCommands(Shell):
5613a61
         self.assert_(not os.path.exists(script))
5613a61
 
5613a61
         # No attempt is made to verify correctness of the repository path here
5613a61
-        result = self.env.run('migrate manage %s --repository=/bla/' % script)
5613a61
+        result = self.env.run('sqlalchemy-migrate manage %s --repository=/bla/' % script)
5613a61
         self.assert_(os.path.exists(script))
5613a61
 
5613a61
 
2edd588
@@ -155,41 +155,41 @@ class TestShellRepository(Shell):
5613a61
         """Create repository, python change script"""
5613a61
         super(TestShellRepository, self).setUp()
5613a61
         self.path_repos = self.tmp_repos()
5613a61
-        result = self.env.run('migrate create %s repository_name' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % self.path_repos)
5613a61
 
5613a61
     def test_version(self):
5613a61
         """Correctly detect repository version"""
5613a61
         # Version: 0 (no scripts yet); successful execution
5613a61
-        result = self.env.run('migrate version --repository=%s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version --repository=%s' % self.path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), "0")
5613a61
 
5613a61
         # Also works as a positional param
5613a61
-        result = self.env.run('migrate version %s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s' % self.path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), "0")
5613a61
 
5613a61
         # Create a script and version should increment
5613a61
-        result = self.env.run('migrate script Desc %s' % self.path_repos)
5613a61
-        result = self.env.run('migrate version %s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate script Desc %s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s' % self.path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), "1")
5613a61
 
5613a61
     def test_source(self):
5613a61
         """Correctly fetch a script's source"""
5613a61
-        result = self.env.run('migrate script Desc --repository=%s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate script Desc --repository=%s' % self.path_repos)
5613a61
 
5613a61
         filename = '%s/versions/001_Desc.py' % self.path_repos
5613a61
         source = open(filename).read()
5613a61
         self.assert_(source.find('def upgrade') >= 0)
5613a61
 
5613a61
         # Version is now 1
5613a61
-        result = self.env.run('migrate version %s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s' % self.path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), "1")
5613a61
 
5613a61
         # Output/verify the source of version 1
5613a61
-        result = self.env.run('migrate source 1 --repository=%s' % self.path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate source 1 --repository=%s' % self.path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), source.strip())
5613a61
 
5613a61
         # We can also send the source to a file... test that too
5613a61
-        result = self.env.run('migrate source 1 %s --repository=%s' %
5613a61
+        result = self.env.run('sqlalchemy-migrate source 1 %s --repository=%s' %
5613a61
             (filename, self.path_repos))
5613a61
         self.assert_(os.path.exists(filename))
5613a61
         fd = open(filename)
2edd588
@@ -209,17 +209,17 @@ class TestShellDatabase(Shell, DB):
5613a61
         """Ensure we can set version control on a database"""
5613a61
         path_repos = repos = self.tmp_repos()
5613a61
         url = self.url
5613a61
-        result = self.env.run('migrate create %s repository_name' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s repository_name' % repos)
5613a61
 
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(repos)s'\
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(repos)s'\
5613a61
             % locals(), expect_error=True)
5613a61
         self.assertEqual(result.returncode, 1)
5613a61
-        result = self.env.run('migrate version_control %(url)s %(repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %(url)s %(repos)s' % locals())
5613a61
 
5613a61
         # Clean up
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(repos)s' % locals())
5613a61
         # Attempting to drop vc from a database without it should fail
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(repos)s'\
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(repos)s'\
5613a61
             % locals(), expect_error=True)
5613a61
         self.assertEqual(result.returncode, 1)
5613a61
 
2edd588
@@ -228,41 +228,41 @@ class TestShellDatabase(Shell, DB):
5613a61
         """Commands with default arguments set by manage.py"""
5613a61
         path_repos = repos = self.tmp_repos()
5613a61
         url = self.url
5613a61
-        result = self.env.run('migrate create --name=repository_name %s' % repos)
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(repos)s' % locals(), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate create --name=repository_name %s' % repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(repos)s' % locals(), expect_error=True)
5613a61
         self.assertEqual(result.returncode, 1)
5613a61
-        result = self.env.run('migrate version_control %(url)s %(repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %(url)s %(repos)s' % locals())
5613a61
 
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(repos)s' % locals())
5613a61
 
5613a61
     @usedb()
5613a61
     def test_version_control_specified(self):
5613a61
         """Ensure we can set version control to a particular version"""
5613a61
         path_repos = self.tmp_repos()
5613a61
         url = self.url
5613a61
-        result = self.env.run('migrate create --name=repository_name %s' % path_repos)
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(path_repos)s' % locals(), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate create --name=repository_name %s' % path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(path_repos)s' % locals(), expect_error=True)
5613a61
         self.assertEqual(result.returncode, 1)
5613a61
 
5613a61
         # Fill the repository
5613a61
         path_script = self.tmp_py()
5613a61
         version = 2
5613a61
         for i in range(version):
5613a61
-            result = self.env.run('migrate script Desc --repository=%s' % path_repos)
5613a61
+            result = self.env.run('sqlalchemy-migrate script Desc --repository=%s' % path_repos)
5613a61
 
5613a61
         # Repository version is correct
5613a61
-        result = self.env.run('migrate version %s' % path_repos)
5613a61
+        result = self.env.run('sqlalchemy-migrate version %s' % path_repos)
5613a61
         self.assertEqual(result.stdout.strip(), str(version))
5613a61
 
5613a61
         # Apply versioning to DB
5613a61
-        result = self.env.run('migrate version_control %(url)s %(path_repos)s %(version)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %(url)s %(path_repos)s %(version)s' % locals())
5613a61
 
5613a61
         # Test db version number (should start at 2)
5613a61
-        result = self.env.run('migrate db_version %(url)s %(path_repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate db_version %(url)s %(path_repos)s' % locals())
5613a61
         self.assertEqual(result.stdout.strip(), str(version))
5613a61
 
5613a61
         # Clean up
5613a61
-        result = self.env.run('migrate drop_version_control %(url)s %(path_repos)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %(url)s %(path_repos)s' % locals())
5613a61
 
5613a61
     @usedb()
5613a61
     def test_upgrade(self):
2edd588
@@ -270,67 +270,67 @@ class TestShellDatabase(Shell, DB):
5613a61
         # Create a repository
5613a61
         repos_name = 'repos_name'
5613a61
         repos_path = self.tmp()
5613a61
-        result = self.env.run('migrate create %(repos_path)s %(repos_name)s' % locals())
5613a61
+        result = self.env.run('sqlalchemy-migrate create %(repos_path)s %(repos_name)s' % locals())
5613a61
         self.assertEquals(self.run_version(repos_path), 0)
5613a61
 
5613a61
         # Version the DB
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
-        result = self.env.run('migrate version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %s %s' % (self.url, repos_path))
5613a61
 
5613a61
         # Upgrades with latest version == 0
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
-        result = self.env.run('migrate upgrade %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
-        result = self.env.run('migrate upgrade %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
-        result = self.env.run('migrate upgrade %s %s 1' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s 1' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 1)
5613a61
-        result = self.env.run('migrate upgrade %s %s -1' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s -1' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 2)
5613a61
 
5613a61
         # Add a script to the repository; upgrade the db
5613a61
-        result = self.env.run('migrate script Desc --repository=%s' % (repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate script Desc --repository=%s' % (repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 1)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
5613a61
         # Test preview
5613a61
-        result = self.env.run('migrate upgrade %s %s 0 --preview_sql' % (self.url, repos_path))
5613a61
-        result = self.env.run('migrate upgrade %s %s 0 --preview_py' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s 0 --preview_sql' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s 0 --preview_py' % (self.url, repos_path))
5613a61
 
5613a61
-        result = self.env.run('migrate upgrade %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 1)
5613a61
         
5613a61
         # Downgrade must have a valid version specified
5613a61
-        result = self.env.run('migrate downgrade %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 2)
5613a61
-        result = self.env.run('migrate downgrade %s %s -1' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s -1' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 2)
5613a61
-        result = self.env.run('migrate downgrade %s %s 2' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s 2' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 2)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 1)
5613a61
         
5613a61
-        result = self.env.run('migrate downgrade %s %s 0' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s 0' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
         
5613a61
-        result = self.env.run('migrate downgrade %s %s 1' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s 1' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEquals(result.returncode, 2)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path))
5613a61
 
5613a61
     def _run_test_sqlfile(self, upgrade_script, downgrade_script):
5613a61
         # TODO: add test script that checks if db really changed
5613a61
         repos_path = self.tmp()
5613a61
         repos_name = 'repos'
5613a61
 
5613a61
-        result = self.env.run('migrate create %s %s' % (repos_path, repos_name))
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
-        result = self.env.run('migrate version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s %s' % (repos_path, repos_name))
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 0)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
5613a61
         beforeCount = len(os.listdir(os.path.join(repos_path, 'versions')))  # hmm, this number changes sometimes based on running from svn
5613a61
-        result = self.env.run('migrate script_sql %s --repository=%s' % ('postgres', repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate script_sql %s --repository=%s' % ('postgres', repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 1)
5613a61
         self.assertEquals(len(os.listdir(os.path.join(repos_path, 'versions'))), beforeCount + 2)
5613a61
 
2edd588
@@ -340,11 +340,11 @@ class TestShellDatabase(Shell, DB):
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
         self.assertRaises(Exception, self.engine.text('select * from t_table').execute)
5613a61
 
5613a61
-        result = self.env.run('migrate upgrade %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate upgrade %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 1)
5613a61
         self.engine.text('select * from t_table').execute()
5613a61
 
5613a61
-        result = self.env.run('migrate downgrade %s %s 0' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate downgrade %s %s 0' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
         self.assertRaises(Exception, self.engine.text('select * from t_table').execute)
5613a61
 
2edd588
@@ -384,15 +384,15 @@ class TestShellDatabase(Shell, DB):
5613a61
         repos_name = 'repos_name'
5613a61
         repos_path = self.tmp()
5613a61
 
5613a61
-        result = self.env.run('migrate create repository_name --repository=%s' % repos_path)
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
-        result = self.env.run('migrate version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate create repository_name --repository=%s' % repos_path)
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 0)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
5613a61
         # Empty script should succeed
5613a61
-        result = self.env.run('migrate script Desc %s' % repos_path)
5613a61
-        result = self.env.run('migrate test %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate script Desc %s' % repos_path)
5613a61
+        result = self.env.run('sqlalchemy-migrate test %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 1)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
2edd588
@@ -414,7 +414,7 @@ class TestShellDatabase(Shell, DB):
5613a61
         file.write(script_text)
5613a61
         file.close()
5613a61
 
5613a61
-        result = self.env.run('migrate test %s %s bla' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate test %s %s bla' % (self.url, repos_path), expect_error=True)
5613a61
         self.assertEqual(result.returncode, 2)
5613a61
         self.assertEquals(self.run_version(repos_path), 1)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
2edd588
@@ -445,7 +445,7 @@ class TestShellDatabase(Shell, DB):
5613a61
         file = open(script_path, 'w')
5613a61
         file.write(script_text)
5613a61
         file.close()
5613a61
-        result = self.env.run('migrate test %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate test %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 1)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
         
2edd588
@@ -465,19 +465,19 @@ class TestShellDatabase(Shell, DB):
5613a61
         self.meta.reflect()
5613a61
         self.meta.drop_all()  # in case junk tables are lying around in the test database
5613a61
 
5613a61
-        result = self.env.run('migrate create %s %s' % (repos_path, repos_name))
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
-        result = self.env.run('migrate version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate create %s %s' % (repos_path, repos_name))
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %s %s' % (self.url, repos_path))
5613a61
         self.assertEquals(self.run_version(repos_path), 0)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)
5613a61
 
5613a61
         # Setup helper script.
5613a61
-        result = self.env.run('migrate manage %s --repository=%s --url=%s --model=%s'\
5613a61
+        result = self.env.run('sqlalchemy-migrate manage %s --repository=%s --url=%s --model=%s'\
5613a61
             % (script_path, repos_path, self.url, model_module))
5613a61
         self.assert_(os.path.exists(script_path))
5613a61
 
5613a61
         # Model is defined but database is empty.
5613a61
-        result = self.env.run('migrate compare_model_to_db %s %s --model=%s' \
5613a61
+        result = self.env.run('sqlalchemy-migrate compare_model_to_db %s %s --model=%s' \
5613a61
             % (self.url, repos_path, model_module))
2edd588
         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
5613a61
 
2edd588
@@ -487,7 +487,7 @@ class TestShellDatabase(Shell, DB):
731cb66
         else:
731cb66
             warnings = None
731cb66
         self.env.environ['PYTHONWARNINGS'] = 'default'
5613a61
-        result = self.env.run('migrate compare_model_to_db %s %s --model=%s' \
5613a61
+        result = self.env.run('sqlalchemy-migrate compare_model_to_db %s %s --model=%s' \
5613a61
             % (self.url, repos_path, model_module.replace(":", ".")), expect_error=True)
731cb66
         if warnings == None:
731cb66
             del(self.env.environ['PYTHONWARNINGS'])
2edd588
@@ -499,19 +499,19 @@ class TestShellDatabase(Shell, DB):
2edd588
         self.assert_("tables missing from database: tmp_account_rundiffs" in result.stdout)
5613a61
 
5613a61
         # Update db to latest model.
5613a61
-        result = self.env.run('migrate update_db_from_model %s %s %s'\
5613a61
+        result = self.env.run('sqlalchemy-migrate update_db_from_model %s %s %s'\
5613a61
             % (self.url, repos_path, model_module))
5613a61
         self.assertEquals(self.run_version(repos_path), 0)
5613a61
         self.assertEquals(self.run_db_version(self.url, repos_path), 0)  # version did not get bumped yet because new version not yet created
5613a61
 
5613a61
-        result = self.env.run('migrate compare_model_to_db %s %s %s'\
5613a61
+        result = self.env.run('sqlalchemy-migrate compare_model_to_db %s %s %s'\
5613a61
             % (self.url, repos_path, model_module))
5613a61
         self.assert_("No schema diffs" in result.stdout)
5613a61
 
5613a61
-        result = self.env.run('migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
-        result = self.env.run('migrate version_control %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate drop_version_control %s %s' % (self.url, repos_path), expect_error=True)
5613a61
+        result = self.env.run('sqlalchemy-migrate version_control %s %s' % (self.url, repos_path))
5613a61
 
5613a61
-        result = self.env.run('migrate create_model %s %s' % (self.url, repos_path))
5613a61
+        result = self.env.run('sqlalchemy-migrate create_model %s %s' % (self.url, repos_path))
5613a61
         temp_dict = dict()
5613a61
         exec result.stdout in temp_dict
5613a61
 
2edd588
@@ -525,10 +525,10 @@ class TestShellDatabase(Shell, DB):
5613a61
   ##Column('passwd', String(length=None, convert_unicode=False, assert_unicode=None))""" in result.stdout)
5613a61
 
5613a61
         ## We're happy with db changes, make first db upgrade script to go from version 0 -> 1.
5613a61
-        #result = self.env.run('migrate make_update_script_for_model', expect_error=True)
5613a61
+        #result = self.env.run('sqlalchemy-migrate make_update_script_for_model', expect_error=True)
5613a61
         #self.assertTrue('Not enough arguments' in result.stderr)
5613a61
 
5613a61
-        #result_script = self.env.run('migrate make_update_script_for_model %s %s %s %s'\
5613a61
+        #result_script = self.env.run('sqlalchemy-migrate make_update_script_for_model %s %s %s %s'\
5613a61
             #% (self.url, repos_path, old_model_module, model_module))
5613a61
         #self.assertEqualsIgnoreWhitespace(result_script.stdout,
5613a61
         #'''from sqlalchemy import *
2edd588
@@ -555,11 +555,11 @@ class TestShellDatabase(Shell, DB):
731cb66
             #tmp_account_rundiffs.drop()''')
731cb66
     
731cb66
         ## Save the upgrade script.
731cb66
-        #result = self.env.run('migrate script Desc %s' % repos_path)
731cb66
+        #result = self.env.run('sqlalchemy-migrate script Desc %s' % repos_path)
731cb66
         #upgrade_script_path = '%s/versions/001_Desc.py' % repos_path
731cb66
         #open(upgrade_script_path, 'w').write(result_script.stdout)
731cb66
 
731cb66
-        #result = self.env.run('migrate compare_model_to_db %s %s %s'\
731cb66
+        #result = self.env.run('sqlalchemy-migrate compare_model_to_db %s %s %s'\
731cb66
             #% (self.url, repos_path, model_module))
731cb66
         #self.assert_("No schema diffs" in result.stdout)
731cb66
 
edccf8a
diff -up sqlalchemy-migrate-0.7.2/setup.py.rename sqlalchemy-migrate-0.7.2/setup.py
edccf8a
--- sqlalchemy-migrate-0.7.2/setup.py.rename	2011-11-01 21:22:44.000000000 +0100
edccf8a
+++ sqlalchemy-migrate-0.7.2/setup.py	2011-11-08 15:53:44.300081034 +0100
edccf8a
@@ -32,8 +32,8 @@ setup(
edccf8a
     license = "MIT",
edccf8a
     entry_points = """
edccf8a
     [console_scripts]
edccf8a
-    migrate = migrate.versioning.shell:main
edccf8a
-    migrate-repository = migrate.versioning.migrate_repository:main
edccf8a
+    sqlalchemy-migrate = migrate.versioning.shell:main
edccf8a
+    sqlalchemy-migrate-repository = migrate.versioning.migrate_repository:main
edccf8a
     """,
edccf8a
     test_suite = "nose.collector",
edccf8a
 )