rorm-orm / rorm-cli

CLI tool of rorm
MIT License
1 stars 0 forks source link

Syntax error with MariaDB with enums #2

Closed WebFreak001 closed 1 year ago

WebFreak001 commented 1 year ago
CREATE TABLE IF NOT EXISTS _rorm__last_migration (id BIGINT(255) PRIMARY KEY AUTO_INCREMENT, updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP, migration_id INT(255) NOT NULL); 
SELECT migration_id FROM _rorm__last_migration ORDER BY id DESC LIMIT 1;
CREATE TABLE user (name VARCHAR(255) NOT NULL , password VARCHAR(255) NOT NULL , email VARCHAR(255) , age SMALLINT(255) NOT NULL, birthday DATETIME , created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP, created_at_2 DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at_2 DATETIME ON UPDATE CURRENT_TIMESTAMP, state ENUM(?, ?, ?, ?) NOT NULL , state_2 ENUM(?, ?, ?, ?) NOT NULL , admin BOOL NOT NULL, valid_until DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, comment VARCHAR(255) NOT NULL  DEFAULT ?, counter INT(255) NOT NULL DEFAULT 1337, own_primary_key BIGINT(255) PRIMARY KEY, some_timestamp DATETIME , uuid INT(255) NOT NULL UNIQUE, some_int INT(255) NOT NULL, common_name VARCHAR(255) NOT NULL , super_common_field INT(255) NOT NULL); 
Error: error returned from database: 1064 (42000): 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 '?, ?, ?, ?) NOT NULL , state_2 ENUM(?, ?, ?, ?) NOT NULL , admin BOOL NOT NUL...' at line 1

Caused by:
    1064 (42000): 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 '?, ?, ?, ?) NOT NULL , state_2 ENUM(?, ?, ?, ?) NOT NULL , admin BOOL NOT NUL...' at line 1
Error: Test all-fields/ failed