Revert "Revert "Export de tous les dossier d'une démarche""

This reverts commit d9a588b52e.
This commit is contained in:
Christophe Robillard 2021-04-29 17:29:47 +02:00
parent 533fa903bc
commit f40d96fbd2
32 changed files with 675 additions and 36 deletions

View file

@ -0,0 +1,17 @@
class CreateArchiveForGroupeInstructeur < ActiveRecord::Migration[6.0]
def change
create_table :archives do |t|
t.string :status, null: false
t.date :month
t.string :content_type, null: false
t.timestamps
end
create_table "archives_groupe_instructeurs", force: :cascade do |t|
t.belongs_to :archive, foreign_key: true, null: false
t.belongs_to :groupe_instructeur, foreign_key: true, null: false
t.timestamps
end
end
end

View file

@ -0,0 +1,5 @@
class RenameContentTypeToToTimeSpanTypeForArchives < ActiveRecord::Migration[6.1]
def change
rename_column :archives, :content_type, :time_span_type
end
end

View file

@ -0,0 +1,6 @@
class AddKeyToArchives < ActiveRecord::Migration[6.1]
def change
add_column :archives, :key, :text, null: false
add_index :archives, [:key, :time_span_type, :month], unique: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_04_27_120002) do
ActiveRecord::Schema.define(version: 2021_04_27_124500) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -81,6 +81,25 @@ ActiveRecord::Schema.define(version: 2021_04_27_120002) do
t.index ["procedure_id"], name: "index_administrateurs_procedures_on_procedure_id"
end
create_table "archives", force: :cascade do |t|
t.string "status", null: false
t.date "month"
t.string "time_span_type", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "key", null: false
t.index ["key", "time_span_type", "month"], name: "index_archives_on_key_and_time_span_type_and_month", unique: true
end
create_table "archives_groupe_instructeurs", force: :cascade do |t|
t.bigint "archive_id", null: false
t.bigint "groupe_instructeur_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["archive_id"], name: "index_archives_groupe_instructeurs_on_archive_id"
t.index ["groupe_instructeur_id"], name: "index_archives_groupe_instructeurs_on_groupe_instructeur_id"
end
create_table "assign_tos", id: :serial, force: :cascade do |t|
t.integer "instructeur_id"
t.datetime "created_at"
@ -735,6 +754,8 @@ ActiveRecord::Schema.define(version: 2021_04_27_120002) do
end
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "archives_groupe_instructeurs", "archives"
add_foreign_key "archives_groupe_instructeurs", "groupe_instructeurs"
add_foreign_key "assign_tos", "groupe_instructeurs"
add_foreign_key "attestation_templates", "procedures"
add_foreign_key "attestations", "dossiers"