After changing the database driver from postgresql_psycopg2 to mysqlclient driver and ran some migrations and saw this error messages:
WARNINGS:
?: (mysql.W002) MariaDB Strict Mode is not set for database connection 'default'
HINT: MariaDB's Strict Mode fixes many data integrity problems in MariaDB, such as data truncation upon insertion, by escalating warnings into errors. It is strongly recommended you activate it. See: https://docs.djangoproject.com/en/4.0/ref/databases/#mysql-sql-mode
Operations to perform:
Apply all migrations: accounts, admin, app, auth, contenttypes, course, payments, quiz, result, sessions
Running migrations:
Applying payments.0002_testclass_array...Traceback (most recent call last):
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\mysql\base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
db.query(q)
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\connections.py", line 255, in query
_mysql.connection.query(self, query)
MySQLdb.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near
'[200] DEFAULT () NULL' at line 1")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\USER\Desktop\Projects\sms\manage.py", line 23, in
main()
File "C:\Users\USER\Desktop\Projects\sms\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management_init_.py", line 446, in execute_from_command_line
utility.execute()
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management_init_.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management\base.py", line 460, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management\base.py", line 98, in wrapped
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\core\management\commands\migrate.py", line 290, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\migrations\executor.py", line 131, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\migrations\executor.py", line 163, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\migrations\executor.py", line 248, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\migrations\migration.py",
line 131, in apply
operation.database_forwards(
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\migrations\operations\fields.py", line 108, in database_forwards
schema_editor.add_field(
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\mysql\schema.py", line 105, in add_field
super().add_field(model, field)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\base\schema.py",
line 641, in add_field
self.execute(sql, params)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\base\schema.py",
line 192, in execute
cursor.execute(sql, params)
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 103, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\django\db\backends\mysql\base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
db.query(q)
File "C:\Users\USER\Envs\sms\Lib\site-packages\MySQLdb\connections.py", line 255, in query
_mysql.connection.query(self, query)
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[200] DEFAULT () NULL' at line 1")
Please is it a must to use postgreSQL?