Fix after review
This commit is contained in:
parent
9764604430
commit
4ea7635dfc
16 changed files with 74 additions and 90 deletions
|
@ -1,7 +1,7 @@
|
|||
class CreateInitiatedMails < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :initiated_mails do |t|
|
||||
t.text :object
|
||||
t.string :object
|
||||
t.text :body
|
||||
t.belongs_to :procedure, index: true, unique: true, foreign_key: true
|
||||
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
class RemoveDepositDatetimeFromDossiers < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
remove_column :dossiers, :deposit_datetime, :datetime
|
||||
end
|
||||
|
||||
def up
|
||||
Dossier.where.not(deposit_datetime: nil).each do |dossier|
|
||||
dossier.update(initiated_at: dossier.deposit_datetime)
|
||||
end
|
||||
remove_column :dossiers, :deposit_datetime, :datetime
|
||||
end
|
||||
|
||||
def down
|
||||
Dossier.where.not(initiated_at: nil).each do |dossier|
|
||||
dossier.update(deposit_datetime: dossier.initiated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateReceivedMails < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :received_mails do |t|
|
||||
t.text :body
|
||||
t.text :object
|
||||
t.string :object
|
||||
t.references :procedure, foreign_key: true
|
||||
|
||||
t.column :created_at, :timestamp, null: true
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateClosedMails < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :closed_mails do |t|
|
||||
t.text :body
|
||||
t.text :object
|
||||
t.string :object
|
||||
t.belongs_to :procedure, index: true, unique: true, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateRefusedMails < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :refused_mails do |t|
|
||||
t.text :body
|
||||
t.text :object
|
||||
t.string :object
|
||||
t.belongs_to :procedure, index: true, unique: true, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
|
|
|
@ -2,7 +2,7 @@ class CreateWithoutContinuationMails < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :without_continuation_mails do |t|
|
||||
t.text :body
|
||||
t.text :object
|
||||
t.string :object
|
||||
t.belongs_to :procedure, index: true, unique: true, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
|
|
11
db/schema.rb
11
db/schema.rb
|
@ -10,7 +10,6 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170307092820) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
|
@ -107,7 +106,7 @@ ActiveRecord::Schema.define(version: 20170307092820) do
|
|||
|
||||
create_table "closed_mails", force: :cascade do |t|
|
||||
t.text "body"
|
||||
t.text "object"
|
||||
t.string "object"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
@ -238,7 +237,7 @@ ActiveRecord::Schema.define(version: 20170307092820) do
|
|||
end
|
||||
|
||||
create_table "initiated_mails", force: :cascade do |t|
|
||||
t.text "object"
|
||||
t.string "object"
|
||||
t.text "body"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
|
@ -357,7 +356,7 @@ ActiveRecord::Schema.define(version: 20170307092820) do
|
|||
|
||||
create_table "received_mails", force: :cascade do |t|
|
||||
t.text "body"
|
||||
t.text "object"
|
||||
t.string "object"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
@ -366,7 +365,7 @@ ActiveRecord::Schema.define(version: 20170307092820) do
|
|||
|
||||
create_table "refused_mails", force: :cascade do |t|
|
||||
t.text "body"
|
||||
t.text "object"
|
||||
t.string "object"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
@ -426,7 +425,7 @@ ActiveRecord::Schema.define(version: 20170307092820) do
|
|||
|
||||
create_table "without_continuation_mails", force: :cascade do |t|
|
||||
t.text "body"
|
||||
t.text "object"
|
||||
t.string "object"
|
||||
t.integer "procedure_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue