diff --git a/app/models/neighborhood/app.rb b/app/models/neighborhood/app.rb new file mode 100644 index 0000000..a4712eb --- /dev/null +++ b/app/models/neighborhood/app.rb @@ -0,0 +1,9 @@ +class Neighborhood::App < ApplicationRecord + self.table_name = "neighborhood_apps" + + include HasTableSync + + has_table_sync base: "appnsN4MzbnfMY0ai", + table: "tbls2fHyQYCtCbYbl", + pat: ENV["NEIGHBORHOOD_AIRTABLE_PAT"] +end diff --git a/app/models/neighborhood/project.rb b/app/models/neighborhood/project.rb new file mode 100644 index 0000000..ff31507 --- /dev/null +++ b/app/models/neighborhood/project.rb @@ -0,0 +1,9 @@ +class Neighborhood::Project < ApplicationRecord + self.table_name = "neighborhood_projects" + + include HasTableSync + + has_table_sync base: "appnsN4MzbnfMY0ai", + table: "tblIqliBgKvoNT3uD", + pat: ENV["NEIGHBORHOOD_AIRTABLE_PAT"] +end diff --git a/db/migrate/20250516142026_create_neighborhood_apps.rb b/db/migrate/20250516142026_create_neighborhood_apps.rb new file mode 100644 index 0000000..4325957 --- /dev/null +++ b/db/migrate/20250516142026_create_neighborhood_apps.rb @@ -0,0 +1,11 @@ +class CreateNeighborhoodApps < ActiveRecord::Migration[8.0] + def change + create_table :neighborhood_apps do |t| + t.string :airtable_id, null: false + t.index :airtable_id, unique: true + t.jsonb :airtable_fields + + t.timestamps + end + end +end diff --git a/db/migrate/20250516142043_create_neighborhood_projects.rb b/db/migrate/20250516142043_create_neighborhood_projects.rb new file mode 100644 index 0000000..6ea052c --- /dev/null +++ b/db/migrate/20250516142043_create_neighborhood_projects.rb @@ -0,0 +1,11 @@ +class CreateNeighborhoodProjects < ActiveRecord::Migration[8.0] + def change + create_table :neighborhood_projects do |t| + t.string :airtable_id, null: false + t.index :airtable_id, unique: true + t.jsonb :airtable_fields + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index bc28fde..8fbff9d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -12,7 +12,7 @@ create_schema "pganalyze" -ActiveRecord::Schema[8.0].define(version: 2025_05_16_140014) do +ActiveRecord::Schema[8.0].define(version: 2025_05_16_142043) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" enable_extension "pg_stat_statements" @@ -264,6 +264,14 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_16_140014) do t.index ["user_id"], name: "index_mailing_addresses_on_user_id" end + create_table "neighborhood_apps", force: :cascade do |t| + t.string "airtable_id", null: false + t.jsonb "airtable_fields" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["airtable_id"], name: "index_neighborhood_apps_on_airtable_id", unique: true + end + create_table "neighborhood_posts", force: :cascade do |t| t.string "airtable_id", null: false t.jsonb "airtable_fields" @@ -272,6 +280,14 @@ ActiveRecord::Schema[8.0].define(version: 2025_05_16_140014) do t.index ["airtable_id"], name: "index_neighborhood_posts_on_airtable_id", unique: true end + create_table "neighborhood_projects", force: :cascade do |t| + t.string "airtable_id", null: false + t.jsonb "airtable_fields" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["airtable_id"], name: "index_neighborhood_projects_on_airtable_id", unique: true + end + create_table "physical_mails", force: :cascade do |t| t.bigint "user_id", null: false t.integer "mission_type", null: false