feat(dossier): add dossier_transfers and dossier_transfer_logs
This commit is contained in:
parent
188c1e70a8
commit
dfafc57bb9
3 changed files with 43 additions and 1 deletions
11
db/migrate/20210721140812_create_dossier_transfers.rb
Normal file
11
db/migrate/20210721140812_create_dossier_transfers.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class CreateDossierTransfers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :dossier_transfers do |t|
|
||||
t.string :email, null: false, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_reference :dossiers, :dossier_transfer, foreign_key: true, null: true, index: true
|
||||
end
|
||||
end
|
11
db/migrate/20210721162213_create_dossier_transfer_logs.rb
Normal file
11
db/migrate/20210721162213_create_dossier_transfer_logs.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class CreateDossierTransferLogs < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :dossier_transfer_logs do |t|
|
||||
t.string :from, null: false
|
||||
t.string :to, null: false
|
||||
t.references :dossier, foreign_key: true, null: false, index: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
22
db/schema.rb
22
db/schema.rb
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_08_26_161956) do
|
||||
ActiveRecord::Schema.define(version: 2021_08_27_161956) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -268,6 +268,22 @@ ActiveRecord::Schema.define(version: 2021_08_26_161956) do
|
|||
t.index ["keep_until"], name: "index_dossier_operation_logs_on_keep_until"
|
||||
end
|
||||
|
||||
create_table "dossier_transfer_logs", force: :cascade do |t|
|
||||
t.string "from", null: false
|
||||
t.string "to", null: false
|
||||
t.bigint "dossier_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["dossier_id"], name: "index_dossier_transfer_logs_on_dossier_id"
|
||||
end
|
||||
|
||||
create_table "dossier_transfers", force: :cascade do |t|
|
||||
t.string "email", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["email"], name: "index_dossier_transfers_on_email"
|
||||
end
|
||||
|
||||
create_table "dossiers", id: :serial, force: :cascade do |t|
|
||||
t.boolean "autorisation_donnees"
|
||||
t.datetime "created_at"
|
||||
|
@ -299,7 +315,9 @@ ActiveRecord::Schema.define(version: 2021_08_26_161956) do
|
|||
t.datetime "declarative_triggered_at"
|
||||
t.index "to_tsvector('french'::regconfig, (search_terms || private_search_terms))", name: "index_dossiers_on_search_terms_private_search_terms", using: :gin
|
||||
t.index "to_tsvector('french'::regconfig, search_terms)", name: "index_dossiers_on_search_terms", using: :gin
|
||||
t.bigint "dossier_transfer_id"
|
||||
t.index ["archived"], name: "index_dossiers_on_archived"
|
||||
t.index ["dossier_transfer_id"], name: "index_dossiers_on_dossier_transfer_id"
|
||||
t.index ["groupe_instructeur_id"], name: "index_dossiers_on_groupe_instructeur_id"
|
||||
t.index ["hidden_at"], name: "index_dossiers_on_hidden_at"
|
||||
t.index ["revision_id"], name: "index_dossiers_on_revision_id"
|
||||
|
@ -797,6 +815,8 @@ ActiveRecord::Schema.define(version: 2021_08_26_161956) do
|
|||
add_foreign_key "commentaires", "experts"
|
||||
add_foreign_key "dossier_operation_logs", "bill_signatures"
|
||||
add_foreign_key "dossier_operation_logs", "instructeurs"
|
||||
add_foreign_key "dossier_transfer_logs", "dossiers"
|
||||
add_foreign_key "dossiers", "dossier_transfers"
|
||||
add_foreign_key "dossiers", "groupe_instructeurs"
|
||||
add_foreign_key "dossiers", "procedure_revisions", column: "revision_id"
|
||||
add_foreign_key "dossiers", "users"
|
||||
|
|
Loading…
Reference in a new issue