def test_adding_json(self):
        blueprint = Blueprint("users")
        blueprint.json("foo")

        statements = blueprint.to_sql(self.get_connection(), self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual('ALTER TABLE "users" ADD COLUMN "foo" JSON NOT NULL', statements[0])
    def test_adding_json(self):
        blueprint = Blueprint("users")
        blueprint.json("foo")

        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual('ALTER TABLE "users" ADD COLUMN "foo" JSON NOT NULL',
                         statements[0])
Beispiel #3
0
    def test_adding_json_mariadb(self):
        blueprint = Blueprint('users')
        blueprint.json('foo')

        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar((10, 6, 0, 'mariadb')))

        self.assertEqual(1, len(statements))
        self.assertEqual('ALTER TABLE `users` ADD `foo` TEXT NOT NULL',
                         statements[0])
Beispiel #4
0
    def test_adding_json_mariadb(self):
        blueprint = Blueprint("users")
        blueprint.json("foo")

        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar((10, 6, 0, "mariadb")))

        self.assertEqual(1, len(statements))
        self.assertEqual("ALTER TABLE `users` ADD `foo` TEXT NOT NULL",
                         statements[0])
Beispiel #5
0
    def test_adding_json(self):
        blueprint = Blueprint('users')
        blueprint.json('foo')

        statements = blueprint.to_sql(self.get_connection(),
                                      self.get_grammar())

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'ALTER TABLE "users" ADD COLUMN "foo" TEXT /*json(%s)*/ NOT NULL',
            statements[0])
Beispiel #6
0
    def test_adding_json_mysql_56(self):
        blueprint = Blueprint('users')
        blueprint.json('foo')

        statements = blueprint.to_sql(self.get_connection(), self.get_grammar((5, 6)))

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'ALTER TABLE `users` ADD `foo` TEXT NOT NULL',
            statements[0]
        )