-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generated model for Expanse, Budget, Category
- Loading branch information
Showing
11 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Budget < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Category < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Expense < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class CreateCategory < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :categories do |t| | ||
t.string :title | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateBudget < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :budgets do |t| | ||
t.date :starts_at | ||
t.date :ends_at | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class CreateExpense < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :expenses do |t| | ||
t.date :date | ||
t.string :title | ||
t.integer :amount | ||
t.references :category, index: true, foreign_key: true | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
[1m[35m (0.9ms)[0m [1m[35mCREATE DATABASE "budget_dev" ENCODING = 'utf8'[0m | ||
[1m[35m (123.4ms)[0m [1m[35mCREATE DATABASE "budget_test" ENCODING = 'utf8'[0m | ||
[1m[35m (12.2ms)[0m [1m[35mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)[0m | ||
[1m[35m (2.0ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)[0m | ||
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(6586007212054593750)[0m | ||
[1m[35m (0.9ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m | ||
Migrating to CreateCategory (20211218205541) | ||
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mBEGIN[0m | ||
[1m[35m (8.1ms)[0m [1m[35mCREATE TABLE "categories" ("id" bigserial primary key, "title" character varying, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)[0m | ||
[1m[36mActiveRecord::SchemaMigration Create (1.1ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20211218205541"]] | ||
[1m[36mTRANSACTION (0.5ms)[0m [1m[35mCOMMIT[0m | ||
Migrating to CreateBudget (20211218205550) | ||
[1m[36mTRANSACTION (0.5ms)[0m [1m[35mBEGIN[0m | ||
[1m[35m (5.7ms)[0m [1m[35mCREATE TABLE "budgets" ("id" bigserial primary key, "starts_at" date, "ends_at" date, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL)[0m | ||
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20211218205550"]] | ||
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m | ||
Migrating to CreateExpense (20211218205555) | ||
[1m[35m (0.8ms)[0m [1m[34mSELECT pg_advisory_unlock(6586007212054593750)[0m | ||
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(6586007212054593750)[0m | ||
[1m[35m (1.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m | ||
Migrating to CreateExpense (20211218205555) | ||
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m | ||
[1m[35m (10.6ms)[0m [1m[35mCREATE TABLE "expenses" ("id" bigserial primary key, "date" date, "title" character varying, "amount" integer, "category_id" bigint, "created_at" timestamp(6) NOT NULL, "updated_at" timestamp(6) NOT NULL, CONSTRAINT "fk_rails_06966d0da0" | ||
FOREIGN KEY ("category_id") | ||
REFERENCES "categories" ("id") | ||
)[0m | ||
[1m[35m (0.6ms)[0m [1m[35mCREATE INDEX "index_expenses_on_category_id" ON "expenses" ("category_id")[0m | ||
[1m[36mActiveRecord::SchemaMigration Create (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20211218205555"]] | ||
[1m[36mTRANSACTION (0.6ms)[0m [1m[35mCOMMIT[0m | ||
[1m[36mActiveRecord::InternalMetadata Load (0.3ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]] | ||
[1m[36mTRANSACTION (0.1ms)[0m [1m[35mBEGIN[0m | ||
[1m[36mActiveRecord::InternalMetadata Create (0.8ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2021-12-18 21:20:21.741362"], ["updated_at", "2021-12-18 21:20:21.741362"]] | ||
[1m[36mTRANSACTION (0.2ms)[0m [1m[35mCOMMIT[0m | ||
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6586007212054593750)[0m | ||
[1m[35m (0.5ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class BudgetTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class CategoryTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "test_helper" | ||
|
||
class ExpenseTest < ActiveSupport::TestCase | ||
# test "the truth" do | ||
# assert true | ||
# end | ||
end |