blob: 3419df4db146166632b5222b50626dea58c89273 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
class CreateOrganisation < ActiveRecord::Migration
def up
create_table :organisations do |t|
t.string :name
t.timestamps
end
change_table :referentials do |n|
n.belongs_to :organisation
end
change_table :users do |u|
u.belongs_to :organisation
end
# Referential.reset_column_information
# User.reset_column_information
# organisation = Organisation.first_or_create(:name => "Chouette")
# Referential.update_all :organisation_id => organisation.id
# User.update_all :organisation_id => organisation.id
end
def down
drop_table :organisations
end
end
|