Skip to content

Commit 4e9af50

Browse files
authored
Merge pull request #2448 from codebar/email-users-table
Create table to record sent emails
2 parents f9edf76 + f65d5c3 commit 4e9af50

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class CreateMemberEmailDeliveries < ActiveRecord::Migration[7.1]
2+
def change
3+
create_table :member_email_deliveries, id: :serial do |t|
4+
t.references :member, foreign_key: true
5+
t.text :subject
6+
t.text :body
7+
t.text :to, array: true, default: []
8+
t.text :cc, array: true, default: []
9+
t.text :bcc, array: true, default: []
10+
11+
t.timestamps
12+
end
13+
end
14+
end

db/schema.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.1].define(version: 2025_08_23_151717) do
13+
ActiveRecord::Schema[7.2].define(version: 2026_01_29_095547) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "plpgsql"
1616

@@ -227,6 +227,7 @@
227227
t.string "audience"
228228
t.boolean "virtual", default: false, null: false
229229
t.string "time_zone", default: "London", null: false
230+
t.index ["date_and_time"], name: "index_events_on_date_and_time"
230231
t.index ["slug"], name: "index_events_on_slug", unique: true
231232
t.index ["venue_id"], name: "index_events_on_venue_id"
232233
end
@@ -370,6 +371,18 @@
370371
t.index ["venue_id"], name: "index_meetings_on_venue_id"
371372
end
372373

374+
create_table "member_email_deliveries", id: :serial, force: :cascade do |t|
375+
t.bigint "member_id"
376+
t.text "subject"
377+
t.text "body"
378+
t.text "to", default: [], array: true
379+
t.text "cc", default: [], array: true
380+
t.text "bcc", default: [], array: true
381+
t.datetime "created_at", null: false
382+
t.datetime "updated_at", null: false
383+
t.index ["member_id"], name: "index_member_email_deliveries_on_member_id"
384+
end
385+
373386
create_table "member_notes", id: :serial, force: :cascade do |t|
374387
t.integer "member_id"
375388
t.integer "author_id"
@@ -566,6 +579,8 @@
566579
t.string "slack_channel"
567580
t.string "slack_channel_link"
568581
t.index ["chapter_id"], name: "index_workshops_on_chapter_id"
582+
t.index ["date_and_time"], name: "index_workshops_on_date_and_time"
569583
end
570584

585+
add_foreign_key "member_email_deliveries", "members"
571586
end

0 commit comments

Comments
 (0)