Skip to content

Commit

Permalink
added defaults to counter_caches
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Bartels committed Dec 20, 2023
1 parent a5d839c commit b54de38
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion db/migrate/20231214203958_devise_create_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def change
t.string :last_name, null: false
t.boolean :admin, default: false
t.integer :quota_max_reservations, default: 45
t.integer :reservations_count
t.integer :reservations_count, default: 0

## Recoverable
t.string :reset_password_token
Expand Down
4 changes: 2 additions & 2 deletions db/migrate/20231214223620_create_tenants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def change
create_table :tenants, id: :uuid do |t|
t.string :name, null: false

t.integer :users_count
t.integer :locations_count
t.integer :users_count, default: 0
t.integer :locations_count, default: 0

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20231214233515_create_locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def change
t.string :name
t.references :tenant, null: false, foreign_key: true, type: :uuid

t.integer :floors_count
t.integer :floors_count, default: 0

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20231215174838_create_floors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def change
t.string :name
t.references :location, null: false, foreign_key: true, type: :uuid

t.integer :rooms_count
t.integer :rooms_count, default: 0

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20231215180919_create_rooms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def change
t.string :name
t.references :floor, null: false, foreign_key: true, type: :uuid

t.integer :desks_count
t.integer :desks_count, default: 0

t.timestamps
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20231215183955_create_desks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def change

t.timestamps

t.integer :reservations_count
t.integer :reservations_count, default: 0
end
add_index :desks, :name, unique: true
end
Expand Down
14 changes: 7 additions & 7 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b54de38

Please sign in to comment.