diff --git a/db/migrate/20180301174625_create_sub_products.rb b/db/migrate/20180301174625_create_sub_products.rb new file mode 100644 index 0000000..f1434eb --- /dev/null +++ b/db/migrate/20180301174625_create_sub_products.rb @@ -0,0 +1,17 @@ +class CreateSubProducts < ActiveRecord::Migration + def change + create_table :sub_products do |t| + t.integer :product_id + t.string :name + t.text :description + t.decimal :price_ht, precision: 10, scale: 2 + t.decimal :price_ht_total, precision: 10, scale: 2 + t.decimal :qte, precision: 10, scale: 2 + t.integer :product_order_product_id + t.integer :fournisseur_id + t.string :reference + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20180301174759_create_fournisseurs.rb b/db/migrate/20180301174759_create_fournisseurs.rb new file mode 100644 index 0000000..6e2ae5e --- /dev/null +++ b/db/migrate/20180301174759_create_fournisseurs.rb @@ -0,0 +1,12 @@ +class CreateFournisseurs < ActiveRecord::Migration + def change + create_table :fournisseurs do |t| + t.string :name + t.text :description + t.string :iban + t.string :bic + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20180301182111_add_sub_product_reference_id_to_sub_products.rb b/db/migrate/20180301182111_add_sub_product_reference_id_to_sub_products.rb new file mode 100644 index 0000000..575c12f --- /dev/null +++ b/db/migrate/20180301182111_add_sub_product_reference_id_to_sub_products.rb @@ -0,0 +1,6 @@ +class AddSubProductReferenceIdToSubProducts < ActiveRecord::Migration + def change + add_column :sub_products, :sub_product_reference_id, :integer + add_column :sub_products, :archived, :boolean + end +end diff --git a/db/migrate/20180301225428_add_shiped_to_product_orders.rb b/db/migrate/20180301225428_add_shiped_to_product_orders.rb new file mode 100644 index 0000000..a6b1923 --- /dev/null +++ b/db/migrate/20180301225428_add_shiped_to_product_orders.rb @@ -0,0 +1,7 @@ +class AddShipedToProductOrders < ActiveRecord::Migration + def change + add_column :product_orders, :shiped, :boolean + + #add_column :product_orders, :paid_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 9964413..682dd3a 100755 --- 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: 20180209010600) do +ActiveRecord::Schema.define(version: 20180301225428) do create_table "abonnements", force: :cascade do |t| t.integer "abonnement_type_id", limit: 4 @@ -371,6 +371,15 @@ ActiveRecord::Schema.define(version: 20180209010600) do t.datetime "updated_at" end + create_table "fournisseurs", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.string "iban", limit: 255 + t.string "bic", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "gallery_contents", force: :cascade do |t| t.string "name", limit: 255 t.text "description", limit: 65535 @@ -889,6 +898,7 @@ ActiveRecord::Schema.define(version: 20180209010600) do t.string "bl_number", limit: 255 t.integer "bl_index", limit: 4 t.integer "bl_year", limit: 4 + t.boolean "shiped", limit: 1 end create_table "product_product_sizes", force: :cascade do |t| @@ -973,6 +983,22 @@ ActiveRecord::Schema.define(version: 20180209010600) do add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree + create_table "sub_products", force: :cascade do |t| + t.integer "product_id", limit: 4 + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.decimal "price_ht", precision: 10, scale: 2 + t.decimal "price_ht_total", precision: 10, scale: 2 + t.decimal "qte", precision: 10, scale: 2 + t.integer "product_order_product_id", limit: 4 + t.integer "fournisseur_id", limit: 4 + t.string "reference", limit: 255 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "sub_product_reference_id", limit: 4 + t.boolean "archived", limit: 1 + end + create_table "table_contents", force: :cascade do |t| t.integer "style", limit: 4 t.integer "nbr_rows", limit: 4