Skip to content

Commit ef75901

Browse files
committed
Create a schools table with an organisation_id index
1 parent 93ce195 commit ef75901

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CreateSchools < ActiveRecord::Migration[7.0]
2+
def change
3+
create_table :schools, id: :uuid do |t|
4+
t.uuid :organisation_id, null: false
5+
t.string :name, null: false
6+
t.timestamps
7+
end
8+
9+
add_index :schools, :organisation_id, unique: true
10+
end
11+
end

db/schema.rb

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)