def test_adding_unique_key(self):
        blueprint = Blueprint("users")
        blueprint.unique("foo", "bar")
        statements = blueprint.to_sql(self.get_connection(), self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual('ALTER TABLE "users" ADD CONSTRAINT bar UNIQUE ("foo")', statements[0])
Beispiel #2
0
    def test_adding_unique_key(self):
        blueprint = Blueprint('users')
        blueprint.unique('foo', 'bar')
        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual('CREATE UNIQUE INDEX bar ON "users" ("foo")',
                         statements[0])
Beispiel #3
0
    def test_adding_unique_key(self):
        blueprint = Blueprint('users')
        blueprint.unique('foo', 'bar')
        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual('ALTER TABLE `users` ADD UNIQUE bar(`foo`)',
                         statements[0])
Beispiel #4
0
    def test_adding_unique_key(self):
        blueprint = Blueprint("users")
        blueprint.unique("foo", "bar")
        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual("ALTER TABLE `users` ADD UNIQUE bar(`foo`)",
                         statements[0])
    def test_adding_unique_key(self):
        blueprint = Blueprint("users")
        blueprint.unique("foo", "bar")
        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'ALTER TABLE "users" ADD CONSTRAINT bar UNIQUE ("foo")',
            statements[0])
Beispiel #6
0
    def test_adding_unique_key(self):
        blueprint = Blueprint('users')
        blueprint.unique('foo', 'bar')
        statements = blueprint.to_sql(self.get_connection(), self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'CREATE UNIQUE INDEX bar ON "users" ("foo")',
            statements[0]
        )
Beispiel #7
0
    def test_adding_unique_key(self):
        blueprint = Blueprint('users')
        blueprint.unique('foo', 'bar')
        statements = blueprint.to_sql(self.get_connection(), self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'ALTER TABLE `users` ADD UNIQUE bar(`foo`)',
            statements[0]
        )