Skip to content

Commit

Permalink
Change all previous migrations to state they were run in rails 4.2 to…
Browse files Browse the repository at this point in the history
… allow migrations in rails 6
  • Loading branch information
Exellin committed Apr 24, 2021
1 parent 8a3f2a5 commit dbecec5
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 44 deletions.
3 changes: 1 addition & 2 deletions db/migrate/20160426204718_create_articles.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class CreateArticles < ActiveRecord::Migration
class CreateArticles < ActiveRecord::Migration[4.2]
def change
create_table :articles do |t|
t.string :title
t.text :description
t.datetime :created_at
t.timestamps
end
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160426220558_rename_description_to_body.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class RenameDescriptionToBody < ActiveRecord::Migration
class RenameDescriptionToBody < ActiveRecord::Migration[4.2]
def change
rename_column :articles, :description, :body
end
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20160428181326_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[4.2]
def change
create_table(:users) do |t|
## Database authenticatable
Expand Down Expand Up @@ -31,7 +31,7 @@ def change
# t.datetime :locked_at

t.timestamps null: false

#custom
t.boolean :admin, default: false
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160501221516_add_user_id_to_articles.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddUserIdToArticles < ActiveRecord::Migration
class AddUserIdToArticles < ActiveRecord::Migration[4.2]
def change
add_column :articles, :user_id, :integer
end
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20160606222210_create_projects_and_tags.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateProjectsAndTags < ActiveRecord::Migration
class CreateProjectsAndTags < ActiveRecord::Migration[4.2]
def change
create_table :projects do |t|
t.string :website_url
Expand All @@ -11,4 +11,4 @@ def change
t.integer :project_id
end
end
end
end
2 changes: 1 addition & 1 deletion db/migrate/20160607180403_add_picture_links_to_projects.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddPictureLinksToProjects < ActiveRecord::Migration
class AddPictureLinksToProjects < ActiveRecord::Migration[4.2]
def change
add_column :projects, :picture_link, :string
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20170304005743_create_topics.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateTopics < ActiveRecord::Migration
class CreateTopics < ActiveRecord::Migration[4.2]
def change
create_table :topics do |t|
t.string :name
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20170304012036_create_article_topics.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateArticleTopics < ActiveRecord::Migration
class CreateArticleTopics < ActiveRecord::Migration[4.2]
def change
create_table :article_topics do |t|
t.references :topic, index: true, foreign_key: true
Expand Down
68 changes: 35 additions & 33 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -1,68 +1,70 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170304012036) do
ActiveRecord::Schema.define(version: 2017_03_04_012036) do

create_table "article_topics", force: :cascade do |t|
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "article_topics", id: :serial, force: :cascade do |t|
t.integer "topic_id"
t.integer "article_id"
t.index ["article_id"], name: "index_article_topics_on_article_id"
t.index ["topic_id"], name: "index_article_topics_on_topic_id"
end

add_index "article_topics", ["article_id"], name: "index_article_topics_on_article_id"
add_index "article_topics", ["topic_id"], name: "index_article_topics_on_topic_id"

create_table "articles", force: :cascade do |t|
t.string "title"
t.text "body"
create_table "articles", id: :serial, force: :cascade do |t|
t.string "title"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.integer "user_id"
end

create_table "projects", force: :cascade do |t|
create_table "projects", id: :serial, force: :cascade do |t|
t.string "website_url"
t.string "github_url"
t.string "title"
t.text "description"
t.text "description"
t.string "picture_link"
end

create_table "tags", force: :cascade do |t|
t.string "name"
create_table "tags", id: :serial, force: :cascade do |t|
t.string "name"
t.integer "project_id"
end

create_table "topics", force: :cascade do |t|
create_table "topics", id: :serial, force: :cascade do |t|
t.string "name"
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"
create_table "users", id: :serial, force: :cascade do |t|
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.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "admin", default: false
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "admin", default: false
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end

add_index "users", ["email"], name: "index_users_on_email", unique: true
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true

add_foreign_key "article_topics", "articles"
add_foreign_key "article_topics", "topics"
end

0 comments on commit dbecec5

Please sign in to comment.