Basic donation records

Adds donation model/table and basic manual management in the admin
panel, as well as basic listing of users' own donations.
This commit is contained in:
2020-12-17 21:55:16 +01:00
parent f3d6e29e4e
commit 40f3e8327a
25 changed files with 333 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ class CreateInvitations < ActiveRecord::Migration[6.0]
t.timestamps
end
add_index :invitations, :user_id
add_index :invitations, :invited_user_id
end

View File

@@ -0,0 +1,15 @@
class CreateDonations < ActiveRecord::Migration[6.0]
def change
create_table :donations do |t|
t.integer :user_id
t.integer :amount_sats
t.integer :amount_eur
t.integer :amount_usd
t.string :public_name
t.timestamps
end
add_index :donations, :user_id
end
end

View File

@@ -10,7 +10,18 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_11_30_132533) do
ActiveRecord::Schema.define(version: 2020_12_17_161544) do
create_table "donations", force: :cascade do |t|
t.integer "user_id"
t.integer "amount_sats"
t.integer "amount_eur"
t.integer "amount_usd"
t.string "public_name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["user_id"], name: "index_donations_on_user_id"
end
create_table "invitations", force: :cascade do |t|
t.string "token"