You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Migration]
Hash = '2856395125008994900'Initial = trueReplaces = []
[[Migration.Operations]]
Type = 'CreateModel'Name = 'user'
[[Migration.Operations.Fields]]
Name = 'id'Type = 'int64'
[[Migration.Operations.Fields.Annotations]]
Type = 'auto_increment'
[[Migration.Operations.Fields.Annotations]]
Type = 'primary_key'
[[Migration.Operations.Fields]]
Name = 'username'Type = 'varchar'
[[Migration.Operations.Fields.Annotations]]
Type = 'max_length'Value = 255
[[Migration.Operations.Fields.Annotations]]
Type = 'not_null'
[[Migration.Operations.Fields]]
Name = 'age'Type = 'int16'
[[Migration.Operations.Fields.Annotations]]
Type = 'not_null'
Then, applying it fails for a newly created, fresh database for rorm-cli migrate --database-config mysql.toml --log-sql:
CREATE TABLE IF NOT EXISTS _rorm__last_migration (id BIGINT(255) , updated_at DATETIME , migration_id INT(255) );
SELECT migration_id FROM _rorm__last_migration ORDER BY id DESC LIMIT 1;
Error: sql build error: VARCHAR must have a max_length annotation
The database only contains an empty _rorm_last_migration table afterwards:
MariaDB [db]> SHOW TABLES;
+-----------------------+
| Tables_in_db |
+-----------------------+
| _rorm__last_migration |
+-----------------------+
1 row in set (0.000 sec)
MariaDB [db]> DESC _rorm__last_migration;
+--------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+-------+
| id | bigint(255) | YES | | NULL | |
| updated_at | datetime | YES | | NULL | |
| migration_id | int(255) | YES | | NULL | |
+--------------+-------------+------+-----+---------+-------+
3 rows in set (0.010 sec)
MariaDB [db]> SELECT * FROM _rorm__last_migration;
Empty set (0.000 sec)
The text was updated successfully, but these errors were encountered:
Suppose the following initial migration:
Then, applying it fails for a newly created, fresh database for
rorm-cli migrate --database-config mysql.toml --log-sql
:The database only contains an empty
_rorm_last_migration
table afterwards:The text was updated successfully, but these errors were encountered: