Add zap model, user relation
This commit is contained in:
13
db/migrate/20240422171653_create_zaps.rb
Normal file
13
db/migrate/20240422171653_create_zaps.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateZaps < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :zaps do |t|
|
||||
t.references :user, null: false, foreign_key: true
|
||||
t.json :request
|
||||
t.json :receipt
|
||||
t.text :payment_request
|
||||
t.bigint :amount
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/schema.rb
14
db/schema.rb
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2024_03_16_153558) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2024_04_22_171653) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -136,8 +136,20 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_16_153558) do
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
end
|
||||
|
||||
create_table "zaps", force: :cascade do |t|
|
||||
t.integer "user_id", null: false
|
||||
t.json "request"
|
||||
t.json "receipt"
|
||||
t.text "payment_request"
|
||||
t.bigint "amount"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["user_id"], name: "index_zaps_on_user_id"
|
||||
end
|
||||
|
||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "remote_storage_authorizations", "app_catalog_web_apps", column: "web_app_id"
|
||||
add_foreign_key "remote_storage_authorizations", "users"
|
||||
add_foreign_key "zaps", "users"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user