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
Following the docs, I've changed the default_columns of the BaseModel, mainly to change the ID column type from Int64 to UUID:
abstractclassBaseModel < Avram::Modelmacrodefault_columns# Sets the type for `id` to `UUID`
primary_key id : UUID# adds the `created_at` and `updated_at` columns
timestamps
enddefself.databaseAppDatabaseendend
Now after running lucky gen.model Todo, this happens:
Expected migration
defmigrate
create table_for(Todo) do
primary_key id : UUID
add_timestamps
endend
Actual migration
defmigrate
create table_for(Todo) do
primary_key id : Int64# <-- the default type
add_timestamps
endend
The text was updated successfully, but these errors were encountered:
This may be tricky to do without a lot of changes. For now you'll have to manually change it to UUID in the migrations.
Maybe what we could do is add a setting to the migration generator that tells it to default to UUID, but that will require reworking some things in CLI. I'll see what we can do to improve this but it might be a bit. Thanks for reporting!
Following the docs, I've changed the
default_columns
of theBaseModel
, mainly to change the ID column type fromInt64
toUUID
:Now after running
lucky gen.model Todo
, this happens:Expected migration
Actual migration
The text was updated successfully, but these errors were encountered: