19 lines
520 B
Crystal
19 lines
520 B
Crystal
class CreateUserAcls::V20211014212427 < Avram::Migrator::Migration::V1
|
|
def migrate
|
|
# Learn about migrations at: https://luckyframework.org/guides/database/migrations
|
|
create table_for(UserAcls) do
|
|
primary_key id : UUID
|
|
add_timestamps
|
|
add_belongs_to user : User, on_delete: :cascade, foreign_key_type: Int64
|
|
add path : String
|
|
add permission : String
|
|
end
|
|
|
|
create_index :user_acls, [:user_id, :path], unique: false
|
|
end
|
|
|
|
def rollback
|
|
drop table_for(UserAcls)
|
|
end
|
|
end
|