wikicr/db/migrations/20211014212427_create_user_acls.cr
Arthur Poulet e9bb1cbdc0
Some checks failed
continuous-integration/drone/push Build is failing
spike: try to install & migrate to lucky
2021-10-15 18:44:23 +02:00

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