Service: create model

This commit is contained in:
simon lehericey 2018-04-17 16:11:49 +02:00
parent c62cddc389
commit fc17b68dc1
9 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,10 @@
class CreateServices < ActiveRecord::Migration[5.2]
def change
create_table :services do |t|
t.string :type_organisme, null: false
t.string :nom, null: false
t.timestamps
end
end
end

View file

@ -0,0 +1,5 @@
class AddServiceToProcedures < ActiveRecord::Migration[5.2]
def change
add_reference :procedures, :service, foreign_key: true
end
end

View file

@ -0,0 +1,5 @@
class AddAdministrateurToServices < ActiveRecord::Migration[5.2]
def change
add_reference :services, :administrateur, foreign_key: true
end
end

View file

@ -0,0 +1,5 @@
class AddUniqueIndexToServices < ActiveRecord::Migration[5.2]
def change
add_index :services, [:administrateur_id, :nom], unique: true
end
end