Skip to content

Commit a829479

Browse files
author
Jonathon Belotti
committed
various migrations that I did to get new schema
1 parent 3145956 commit a829479

12 files changed

+97
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddFieldnameNameToOrganization < ActiveRecord::Migration[5.0]
2+
def change
3+
add_column :organizations, :name, :string
4+
end
5+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class CreateUsers < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :users do |t|
4+
t.string :username
5+
6+
t.timestamps
7+
end
8+
end
9+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class CreateOrgRepositories < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :org_repositories do |t|
4+
t.string :name
5+
t.string :url
6+
t.references :organization, foreign_key: true
7+
8+
t.timestamps
9+
end
10+
end
11+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class CreateRepositoryModel < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :repositories do |t|
4+
t.string :name
5+
t.string :url
6+
t.references :owner, polymorphic: true, index: true
7+
end
8+
end
9+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class DropOrgRepositoriesTable < ActiveRecord::Migration[5.0]
2+
def change
3+
drop_table :org_repositories
4+
end
5+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class CreateEvents < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :events do |t|
4+
t.string :type
5+
t.references :repository, foreign_key: true
6+
t.references :user, foreign_key: true
7+
t.references :organization, foreign_key: true
8+
t.integer :gh_id
9+
t.boolean :public
10+
11+
t.timestamps
12+
end
13+
end
14+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class CreateRelationships < ActiveRecord::Migration[5.0]
2+
def change
3+
create_table :relationships do |t|
4+
t.integer :follower_id
5+
t.integer :followed_id
6+
7+
t.timestamps
8+
end
9+
10+
add_index :relationships, :follower_id
11+
add_index :relationships, :followed_id
12+
add_index :relationships, [:follower_id, :followed_id], unique: true
13+
end
14+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddLanguageToRepositories < ActiveRecord::Migration[5.0]
2+
def change
3+
add_column :repositories, :language, :string
4+
end
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddStarsToRepositories < ActiveRecord::Migration[5.0]
2+
def change
3+
add_column :repositories, :stars, :integer
4+
end
5+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddForksToRepositories < ActiveRecord::Migration[5.0]
2+
def change
3+
add_column :repositories, :forks, :integer
4+
end
5+
end

0 commit comments

Comments
 (0)