Beispiel #1
0
    def test_charset_collation_create(self):
        blueprint = Blueprint('users')
        blueprint.create()
        blueprint.increments('id')
        blueprint.string('email')
        blueprint.charset = 'utf8mb4'
        blueprint.collation = 'utf8mb4_unicode_ci'

        conn = self.get_connection()

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

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'CREATE TABLE `users` ('
            '`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, '
            '`email` VARCHAR(255) NOT NULL) '
            'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci',
            statements[0])
Beispiel #2
0
    def test_charset_collation_create(self):
        blueprint = Blueprint('users')
        blueprint.create()
        blueprint.increments('id')
        blueprint.string('email')
        blueprint.charset = 'utf8mb4'
        blueprint.collation = 'utf8mb4_unicode_ci'

        conn = self.get_connection()

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

        self.assertEqual(1, len(statements))
        self.assertEqual(
            'CREATE TABLE `users` ('
            '`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, '
            '`email` VARCHAR(255) NOT NULL) '
            'DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci',
            statements[0]
        )
Beispiel #3
0
    def test_charset_collation_create(self):
        blueprint = Blueprint("users")
        blueprint.create()
        blueprint.increments("id")
        blueprint.string("email")
        blueprint.charset = "utf8mb4"
        blueprint.collation = "utf8mb4_unicode_ci"

        conn = self.get_connection()

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

        self.assertEqual(1, len(statements))
        self.assertEqual(
            "CREATE TABLE `users` ("
            "`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "
            "`email` VARCHAR(255) NOT NULL) "
            "DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
            statements[0],
        )