diff --git a/app/models/email_event.rb b/app/models/email_event.rb new file mode 100644 index 000000000..03a0708ca --- /dev/null +++ b/app/models/email_event.rb @@ -0,0 +1,18 @@ +# == Schema Information +# +# Table name: email_events +# +# id :bigint not null, primary key +# method :string not null +# processed_at :datetime +# status :string not null +# subject :string not null +# to :string not null +# created_at :datetime not null +# updated_at :datetime not null +# +class EmailEvent < ApplicationRecord + enum status: { + dispatched: 'dispatched' + } +end diff --git a/db/migrate/20230109140138_create_email_events.rb b/db/migrate/20230109140138_create_email_events.rb new file mode 100644 index 000000000..90d5e7b73 --- /dev/null +++ b/db/migrate/20230109140138_create_email_events.rb @@ -0,0 +1,13 @@ +class CreateEmailEvents < ActiveRecord::Migration[6.1] + def change + create_table :email_events do |t| + t.string :to, null: false + t.string :method, null: false + t.string :status, null: false + t.string :subject, null: false + t.datetime :processed_at + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 262138d5a..6fa8d9a5c 100644 --- a/db/schema.rb +++ b/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: 2022_12_27_084442) do +ActiveRecord::Schema.define(version: 2023_01_09_140138) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -407,6 +407,16 @@ ActiveRecord::Schema.define(version: 2022_12_27_084442) do t.index ["type_de_champ_id"], name: "index_drop_down_lists_on_type_de_champ_id" end + create_table "email_events", force: :cascade do |t| + t.datetime "created_at", precision: 6, null: false + t.string "method", null: false + t.datetime "processed_at" + t.string "status", null: false + t.string "subject", null: false + t.string "to", null: false + t.datetime "updated_at", precision: 6, null: false + end + create_table "etablissements", id: :serial, force: :cascade do |t| t.string "adresse" t.date "association_date_creation"