diff --git a/config/database.yml b/config/database.yml index 3094b64..2b975b1 100644 --- a/config/database.yml +++ b/config/database.yml @@ -16,6 +16,7 @@ default: &default username: <%= ENV.fetch("DB_USERNAME") { "root" } %> password: <%= ENV.fetch("DB_PASSWORD") { "root" } %> host: <%= ENV.fetch("DB_HOST") { "127.0.0.1" } %> + port: <%= ENV.fetch("DB_port") { 3306 } %> development: <<: *default diff --git a/db/migrate/20250823145902_create_parties.rb b/db/migrate/20250823145902_create_parties.rb index 5d2de99..a7fadf4 100644 --- a/db/migrate/20250823145902_create_parties.rb +++ b/db/migrate/20250823145902_create_parties.rb @@ -6,14 +6,19 @@ class CreateParties < ActiveRecord::Migration[8.0] t.integer :state, default: 0, null: false t.string :venue_name, null: false t.string :venue_address, null: false + t.datetime start_time, :start_time + t.datetime end_datetime, :start_time t.decimal :latitude, precision: 10, scale: 6, null: false t.decimal :longitude, precision: 10, scale: 6, null: false t.boolean :featured, default: false, null: false t.timestamps + + t.references :user, null: false, foreign_key: true end add_index :parties, :state add_index :parties, :featured - add_index :parties, [:latitude, :longitude] + add_index :parties, [ :latitude, :longitude ] end -end \ No newline at end of file +end + diff --git a/db/schema.rb b/db/schema.rb index 1870a23..b714b53 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,20 +10,18 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2025_08_23_171354) do +ActiveRecord::Schema[8.0].define(version: 2025_08_24_211013) do create_table "parties", charset: "utf8mb4", collation: "utf8mb4_uca1400_ai_ci", force: :cascade do |t| t.string "name", null: false t.text "description", null: false t.integer "state", default: 0, null: false - t.string "venue_name", null: false - t.string "venue_address", null: false - t.decimal "latitude", precision: 10, scale: 6, null: false - t.decimal "longitude", precision: 10, scale: 6, null: false - t.boolean "featured", default: false, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["featured"], name: "index_parties_on_featured" - t.index ["latitude", "longitude"], name: "index_parties_on_latitude_and_longitude" + t.integer "promoter_id" + t.datetime "start_time" + t.datetime "end_time" + t.string "location" + t.index ["promoter_id"], name: "index_parties_on_promoter_id" t.index ["state"], name: "index_parties_on_state" end diff --git a/docs/architecture.md b/docs/architecture.md index 963657b..cac7273 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -359,4 +359,5 @@ end - Sanitize HTML output to prevent XSS - Secure payment processing with PCI compliance - Implement rate limiting for API endpoints -- Regular security audits and dependency updates \ No newline at end of file +- Regular security audits and dependency updates +