From 133b832d781afa128bb19fbb05ebda10401e45c0 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 23 Jun 2014 17:50:51 +0200 Subject: [PATCH] fix database migrations --- db/schema.rb | 38 +++++++++---------- ...=> 20090120184410_create_messages.rb.skip} | 6 +++ 2 files changed, 25 insertions(+), 19 deletions(-) rename lib/foodsoft_messages/db/migrate/{20090120184410_create_messages.rb => 20090120184410_create_messages.rb.skip} (56%) diff --git a/db/schema.rb b/db/schema.rb index 4d78e630..94cc7f65 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140102170431) do +ActiveRecord::Schema.define(version: 20140318173000) do create_table "article_categories", force: true do |t| t.string "name", default: "", null: false @@ -22,9 +22,9 @@ ActiveRecord::Schema.define(version: 20140102170431) do create_table "article_prices", force: true do |t| t.integer "article_id" - t.decimal "price", precision: 8, scale: 2, default: 0.0, null: false - t.decimal "tax", precision: 8, scale: 2, default: 0.0, null: false - t.decimal "deposit", precision: 8, scale: 2, default: 0.0, null: false + t.decimal "price", precision: 8, scale: 2, default: 0, null: false + t.decimal "tax", precision: 8, scale: 2, default: 0, null: false + t.decimal "deposit", precision: 8, scale: 2, default: 0, null: false t.integer "unit_quantity" t.datetime "created_at" end @@ -43,7 +43,7 @@ ActiveRecord::Schema.define(version: 20140102170431) do t.datetime "shared_updated_on" t.decimal "price", precision: 8, scale: 2 t.float "tax" - t.decimal "deposit", precision: 8, scale: 2, default: 0.0 + t.decimal "deposit", precision: 8, scale: 2, default: 0 t.integer "unit_quantity", default: 1, null: false t.string "order_number" t.datetime "created_at" @@ -88,11 +88,11 @@ ActiveRecord::Schema.define(version: 20140102170431) do add_index "deliveries", ["supplier_id"], name: "index_deliveries_on_supplier_id", using: :btree create_table "financial_transactions", force: true do |t| - t.integer "ordergroup_id", default: 0, null: false - t.decimal "amount", precision: 8, scale: 2, default: 0.0, null: false - t.text "note", null: false - t.integer "user_id", default: 0, null: false - t.datetime "created_on", null: false + t.integer "ordergroup_id", default: 0, null: false + t.decimal "amount", precision: 8, scale: 2, default: 0, null: false + t.text "note", null: false + t.integer "user_id", default: 0, null: false + t.datetime "created_on", null: false end add_index "financial_transactions", ["ordergroup_id"], name: "index_financial_transactions_on_ordergroup_id", using: :btree @@ -121,11 +121,11 @@ ActiveRecord::Schema.define(version: 20140102170431) do add_index "group_order_articles", ["order_article_id"], name: "index_group_order_articles_on_order_article_id", using: :btree create_table "group_orders", force: true do |t| - t.integer "ordergroup_id", default: 0, null: false - t.integer "order_id", default: 0, null: false - t.decimal "price", precision: 8, scale: 2, default: 0.0, null: false - t.integer "lock_version", default: 0, null: false - t.datetime "updated_on", null: false + t.integer "ordergroup_id", default: 0, null: false + t.integer "order_id", default: 0, null: false + t.decimal "price", precision: 8, scale: 2, default: 0, null: false + t.integer "lock_version", default: 0, null: false + t.datetime "updated_on", null: false t.integer "updated_by_user_id" end @@ -137,7 +137,7 @@ ActiveRecord::Schema.define(version: 20140102170431) do t.string "type", default: "", null: false t.string "name", default: "", null: false t.string "description" - t.decimal "account_balance", precision: 8, scale: 2, default: 0.0, null: false + t.decimal "account_balance", precision: 8, scale: 2, default: 0, null: false t.datetime "created_on", null: false t.boolean "role_admin", default: false, null: false t.boolean "role_suppliers", default: false, null: false @@ -173,9 +173,9 @@ ActiveRecord::Schema.define(version: 20140102170431) do t.date "date" t.date "paid_on" t.text "note" - t.decimal "amount", precision: 8, scale: 2, default: 0.0, null: false - t.decimal "deposit", precision: 8, scale: 2, default: 0.0, null: false - t.decimal "deposit_credit", precision: 8, scale: 2, default: 0.0, null: false + t.decimal "amount", precision: 8, scale: 2, default: 0, null: false + t.decimal "deposit", precision: 8, scale: 2, default: 0, null: false + t.decimal "deposit_credit", precision: 8, scale: 2, default: 0, null: false t.datetime "created_at" t.datetime "updated_at" end diff --git a/lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb b/lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb.skip similarity index 56% rename from lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb rename to lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb.skip index b804d2da..29bb25d1 100644 --- a/lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb +++ b/lib/foodsoft_messages/db/migrate/20090120184410_create_messages.rb.skip @@ -1,3 +1,9 @@ +# This migration has a ".skip" suffix to prevent it from being recognised as +# a migration. While this migration is relevant for the messages plugin, it +# was already included in stock foodsoft when messages were part of its core. +# `rake db:install:migrations` would install this migration, resulting in an +# attempt to create an already existing messages table. +# # extracted from 20090120184410_road_to_version_three.rb class CreateMessages < ActiveRecord::Migration def self.up