2019-07-06 00:21:49 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Crea la tabla de roles
|
|
|
|
class CreateRoles < ActiveRecord::Migration[5.2]
|
2019-07-08 16:40:41 +00:00
|
|
|
def up
|
2019-07-06 00:21:49 +00:00
|
|
|
create_table :roles do |t|
|
|
|
|
t.timestamps
|
|
|
|
t.belongs_to :site
|
|
|
|
t.belongs_to :usuarie
|
|
|
|
t.string :rol
|
|
|
|
t.boolean :temporal
|
|
|
|
|
|
|
|
# Solo podemos tener un rol a la vez
|
|
|
|
t.index %i[site_id usuarie_id], unique: true
|
|
|
|
end
|
|
|
|
end
|
2019-07-08 16:40:41 +00:00
|
|
|
|
|
|
|
def down; end
|
2019-07-06 00:21:49 +00:00
|
|
|
end
|