Skip to content

Commit

Permalink
permission-engine/src/database: add column quantity to space_equipmen…
Browse files Browse the repository at this point in the history
…t table
  • Loading branch information
fatihohn committed Oct 15, 2024
1 parent 3b05cc1 commit 9c450a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions permission-engine/src/database/dbml/tables.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Table space_equipment {
space_id uuid
name varchar [not null]
type varchar
quantity integer [not null, default: 1]
details text
is_active bool [not null, default: true]
created_at timestamptz [default: `CURRENT_TIMESTAMP`]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'space_equipment'
AND column_name = 'quantity'
) THEN
EXECUTE 'ALTER TABLE space_equipment ADD COLUMN quantity INTEGER NOT NULL DEFAULT 1';
END IF;
END $$;
1 change: 1 addition & 0 deletions permission-engine/src/lib/type/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export enum RuleBlockType {
// spaceEvent
spaceEventGeneral = 'space_event:general',
spaceEventAccess = 'space_event:access',
spaceEventRequireEquipment = 'space_event:require_equipment',
}

export enum PermissionRequestStatus {
Expand Down

0 comments on commit 9c450a2

Please sign in to comment.