mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Upgrade migrations
This commit is contained in:
parent
955cc7f603
commit
50f1fc25aa
@ -1,4 +1,4 @@
|
||||
class CreateCategories < ActiveRecord::Migration
|
||||
class CreateCategories < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
create_table :categories do |t|
|
||||
t.string :name
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class CreatePhotos < ActiveRecord::Migration
|
||||
class CreatePhotos < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
create_table :photos do |t|
|
||||
t.integer :category_id
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddPhotoToCategory < ActiveRecord::Migration
|
||||
class AddPhotoToCategory < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :categories, :photo_id, :integer
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddDetailsToPhoto < ActiveRecord::Migration
|
||||
class AddDetailsToPhoto < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :title, :string
|
||||
add_column :photos, :description, :text
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddColourToCategory < ActiveRecord::Migration
|
||||
class AddColourToCategory < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :categories, :base_colour, :string
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddSortOrders < ActiveRecord::Migration
|
||||
class AddSortOrders < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :sort, :integer
|
||||
add_column :categories, :sort, :integer
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class MoveToManyToMany < ActiveRecord::Migration
|
||||
class MoveToManyToMany < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
remove_column :photos, :category_id
|
||||
create_table :categories_photos, id: false do |t|
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class CreateAdminUsers < ActiveRecord::Migration
|
||||
class CreateAdminUsers < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
create_table :admin_users do |t|
|
||||
t.string :first_name, default: "", null: false
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class CreatePages < ActiveRecord::Migration
|
||||
class CreatePages < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
create_table :pages do |t|
|
||||
t.string :name
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class PhotoShowcase < ActiveRecord::Migration
|
||||
class PhotoShowcase < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :featured, :boolean, default: false
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddEnabledToPhotos < ActiveRecord::Migration
|
||||
class AddEnabledToPhotos < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :enabled, :boolean, default: true
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddTakenDateToPhoto < ActiveRecord::Migration
|
||||
class AddTakenDateToPhoto < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :taken_at, :datetime
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddViewCountToPhotos < ActiveRecord::Migration
|
||||
class AddViewCountToPhotos < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
add_column :photos, :views, :integer, default: 0
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddSessionsTable < ActiveRecord::Migration
|
||||
class AddSessionsTable < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
create_table :sessions do |t|
|
||||
t.string :session_id, null: false
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class RemoveAdminUsers < ActiveRecord::Migration
|
||||
class RemoveAdminUsers < ActiveRecord::Migration[5.1]
|
||||
def self.up
|
||||
drop_table :admin_users
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class CreateDeviseAdminUsers < ActiveRecord::Migration
|
||||
class CreateDeviseAdminUsers < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
create_table(:admin_users) do |t|
|
||||
# Database authenticatable
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddSlugToCategories < ActiveRecord::Migration
|
||||
class AddSlugToCategories < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_column :categories, :slug, :string
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddDragonflyImageToPhotos < ActiveRecord::Migration
|
||||
class AddDragonflyImageToPhotos < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_column :photos, :image_uid, :string
|
||||
add_column :photos, :image_name, :string
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class RemovePaperclipColumnsFromPhotos < ActiveRecord::Migration
|
||||
class RemovePaperclipColumnsFromPhotos < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
remove_column :photos, :photo_file_name
|
||||
remove_column :photos, :photo_content_type
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class AddIndexToCategoriesPhotos < ActiveRecord::Migration
|
||||
class AddIndexToCategoriesPhotos < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
add_index :categories_photos, [:category_id, :photo_id], unique: true
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class RemoveDeviseAdminUsers < ActiveRecord::Migration
|
||||
class RemoveDeviseAdminUsers < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
drop_table :admin_users
|
||||
end
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
class CreateUsers < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.string :email, null: false
|
||||
|
||||
38
db/schema.rb
38
db/schema.rb
@ -10,20 +10,20 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20151028124718) do
|
||||
ActiveRecord::Schema.define(version: 2015_10_23_165644) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "categories", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "photo_id"
|
||||
t.string "base_colour", limit: 255
|
||||
t.string "base_colour"
|
||||
t.integer "sort"
|
||||
t.string "slug", limit: 255
|
||||
t.string "slug"
|
||||
end
|
||||
|
||||
create_table "categories_photos", id: false, force: :cascade do |t|
|
||||
@ -33,33 +33,33 @@ ActiveRecord::Schema.define(version: 20151028124718) do
|
||||
end
|
||||
|
||||
create_table "pages", force: :cascade do |t|
|
||||
t.string "name", limit: 255
|
||||
t.string "title", limit: 255
|
||||
t.string "name"
|
||||
t.string "title"
|
||||
t.text "content"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "photos", force: :cascade do |t|
|
||||
t.string "flickr_url", limit: 255
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "title", limit: 255
|
||||
t.string "flickr_url"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "title"
|
||||
t.text "description"
|
||||
t.integer "sort"
|
||||
t.boolean "featured", default: false
|
||||
t.boolean "enabled", default: true
|
||||
t.datetime "taken_at"
|
||||
t.integer "views", default: 0
|
||||
t.string "image_uid", limit: 255
|
||||
t.string "image_name", limit: 255
|
||||
t.string "image_uid"
|
||||
t.string "image_name"
|
||||
end
|
||||
|
||||
create_table "sessions", force: :cascade do |t|
|
||||
t.string "session_id", limit: 255, null: false
|
||||
t.string "session_id", null: false
|
||||
t.text "data"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["session_id"], name: "index_sessions_on_session_id"
|
||||
t.index ["updated_at"], name: "index_sessions_on_updated_at"
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user