Skip to content

Commit

Permalink
Fixing migrations versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasjimenez10 committed Oct 24, 2017
1 parent c1d9e99 commit 8565f51
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 104 deletions.
2 changes: 1 addition & 1 deletion db/migrate/20150617010614_create_posts.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreatePosts < ActiveRecord::Migration
class CreatePosts < ActiveRecord::Migration[5.0]
def change
create_table :posts do |t|
t.text :content
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150617013037_add_attachment_image_to_posts.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddAttachmentImageToPosts < ActiveRecord::Migration
class AddAttachmentImageToPosts < ActiveRecord::Migration[5.0]
def self.up
change_table :posts do |t|
t.attachment :attachment
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150711011916_devise_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class DeviseCreateUsers < ActiveRecord::Migration
class DeviseCreateUsers < ActiveRecord::Migration[5.0]
def change
create_table(:users) do |t|
## Database authenticatable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddFirstNameLastNameUserNameToUser < ActiveRecord::Migration
class AddFirstNameLastNameUserNameToUser < ActiveRecord::Migration[5.0]
def change
add_column :users, :first_name, :string
add_column :users, :last_name, :string
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150711072447_add_user_id_to_posts.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddUserIdToPosts < ActiveRecord::Migration
class AddUserIdToPosts < ActiveRecord::Migration[5.0]
def change
add_reference :posts, :user, index: true
add_foreign_key :posts, :users
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20150713011155_create_comments.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateComments < ActiveRecord::Migration
class CreateComments < ActiveRecord::Migration[5.0]
def change
create_table :comments do |t|
t.references :user, index: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddAttachmentAvatarToUsers < ActiveRecord::Migration
class AddAttachmentAvatarToUsers < ActiveRecord::Migration[5.0]
def self.up
change_table :users do |t|
t.attachment :avatar
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20151016103736_add_bio_to_users.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddBioToUsers < ActiveRecord::Migration
class AddBioToUsers < ActiveRecord::Migration[5.0]
def change
add_column :users, :bio, :text
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20151029095601_acts_as_votable_migration.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class ActsAsVotableMigration < ActiveRecord::Migration
class ActsAsVotableMigration < ActiveRecord::Migration[5.0]
def self.up
create_table :votes do |t|

Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160629131918_add_index_to_user.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddIndexToUser < ActiveRecord::Migration
class AddIndexToUser < ActiveRecord::Migration[5.0]
def change
add_index :users, :user_name,unique: true
end
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20160630205627_create_follow_join_table.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateFollowJoinTable < ActiveRecord::Migration
class CreateFollowJoinTable < ActiveRecord::Migration[5.0]
def change
create_table 'follows' do |t|
t.integer 'following_id', :null => false
Expand All @@ -11,4 +11,4 @@ def change
add_index :follows, :follower_id
add_index :follows, [:following_id, :follower_id], unique: true
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddAttachmentThumbnailImageToGroups < ActiveRecord::Migration
class AddAttachmentThumbnailImageToGroups < ActiveRecord::Migration[5.0]
def self.up
change_table :groups do |t|
t.attachment :thumbnail_image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddAttachmentTimelineImageToGroups < ActiveRecord::Migration
class AddAttachmentTimelineImageToGroups < ActiveRecord::Migration[5.0]
def self.up
change_table :groups do |t|
t.attachment :timeline_image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddAttachmentAttachmentToPersonalMessages < ActiveRecord::Migration
class AddAttachmentAttachmentToPersonalMessages < ActiveRecord::Migration[5.0]
def self.up
change_table :personal_messages do |t|
t.attachment :attachment
Expand Down
180 changes: 91 additions & 89 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,47 @@
ActiveRecord::Schema.define(version: 20170116043801) do

create_table "chat_rooms", force: :cascade do |t|
t.string "title"
t.integer "user_id"
t.string "title"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_chat_rooms_on_user_id"
end

create_table "comments", force: :cascade do |t|
t.integer "user_id"
t.integer "post_id"
t.text "content"
t.integer "user_id"
t.integer "post_id"
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["post_id"], name: "index_comments_on_post_id"
t.index ["user_id"], name: "index_comments_on_user_id"
end

create_table "conversations", force: :cascade do |t|
t.integer "author_id"
t.integer "receiver_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "author_id"
t.integer "receiver_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["author_id", "receiver_id"], name: "index_conversations_on_author_id_and_receiver_id", unique: true
t.index ["author_id"], name: "index_conversations_on_author_id"
t.index ["receiver_id"], name: "index_conversations_on_receiver_id"
end

create_table "follows", force: :cascade do |t|
t.integer "following_id", null: false
t.integer "follower_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "following_id", null: false
t.integer "follower_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["follower_id"], name: "index_follows_on_follower_id"
t.index ["following_id", "follower_id"], name: "index_follows_on_following_id_and_follower_id", unique: true
t.index ["following_id"], name: "index_follows_on_following_id"
end

create_table "group_memberships", force: :cascade do |t|
t.integer "user_id"
t.integer "group_id"
t.integer "role_id"
t.integer "user_id"
t.integer "group_id"
t.integer "role_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["group_id"], name: "index_group_memberships_on_group_id"
Expand All @@ -63,116 +63,116 @@
end

create_table "group_messages", force: :cascade do |t|
t.text "body"
t.integer "user_id"
t.integer "group_id"
t.text "body"
t.integer "user_id"
t.integer "group_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["group_id"], name: "index_group_messages_on_group_id"
t.index ["user_id"], name: "index_group_messages_on_user_id"
end

create_table "groups", force: :cascade do |t|
t.string "name"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "thumbnail_image_file_name"
t.string "thumbnail_image_content_type"
t.integer "thumbnail_image_file_size"
t.string "name"
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "thumbnail_image_file_name"
t.string "thumbnail_image_content_type"
t.integer "thumbnail_image_file_size"
t.datetime "thumbnail_image_updated_at"
t.string "timeline_image_file_name"
t.string "timeline_image_content_type"
t.integer "timeline_image_file_size"
t.string "timeline_image_file_name"
t.string "timeline_image_content_type"
t.integer "timeline_image_file_size"
t.datetime "timeline_image_updated_at"
end

create_table "messages", force: :cascade do |t|
t.text "body"
t.integer "user_id"
t.integer "chat_room_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "body"
t.integer "user_id"
t.integer "chat_room_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["chat_room_id"], name: "index_messages_on_chat_room_id"
t.index ["user_id"], name: "index_messages_on_user_id"
end

create_table "notifications", force: :cascade do |t|
t.integer "recipient_id"
t.integer "actor_id"
t.integer "recipient_id"
t.integer "actor_id"
t.datetime "read_at"
t.string "action"
t.integer "notifiable_id"
t.string "notifiable_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "action"
t.integer "notifiable_id"
t.string "notifiable_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "personal_messages", force: :cascade do |t|
t.text "body"
t.integer "conversation_id"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "attachment_file_name"
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.text "body"
t.integer "conversation_id"
t.integer "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "attachment_file_name"
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.datetime "attachment_updated_at"
t.index ["conversation_id"], name: "index_personal_messages_on_conversation_id"
t.index ["user_id"], name: "index_personal_messages_on_user_id"
end

create_table "posts", force: :cascade do |t|
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "attachment_file_name"
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "attachment_file_name"
t.string "attachment_content_type"
t.integer "attachment_file_size"
t.datetime "attachment_updated_at"
t.integer "user_id"
t.string "postable_type"
t.integer "postable_id"
t.integer "user_id"
t.string "postable_type"
t.integer "postable_id"
t.index ["postable_id", "postable_type"], name: "index_posts_on_postable_id_and_postable_type"
t.index ["user_id"], name: "index_posts_on_user_id"
end

create_table "roles", force: :cascade do |t|
t.string "name"
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token"
t.string "unconfirmed_email"
t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_name"
t.string "last_name"
t.string "user_name"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "first_name"
t.string "last_name"
t.string "user_name"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.text "bio"
t.boolean "is_female", default: false
t.integer "role_id"
t.text "bio"
t.boolean "is_female", default: false
t.integer "role_id"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
Expand All @@ -182,17 +182,19 @@
end

create_table "votes", force: :cascade do |t|
t.string "votable_type"
t.integer "votable_id"
t.string "voter_type"
t.integer "voter_id"
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.datetime "created_at"
t.datetime "updated_at"
t.string "votable_type"
t.integer "votable_id"
t.string "voter_type"
t.integer "voter_id"
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope"
t.index ["votable_type", "votable_id"], name: "index_votes_on_votable_type_and_votable_id"
t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope"
t.index ["voter_type", "voter_id"], name: "index_votes_on_voter_type_and_voter_id"
end

end

0 comments on commit 8565f51

Please sign in to comment.