-
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.
Implemented Functionality entity and associated table (#183)
- Loading branch information
Showing
7 changed files
with
50 additions
and
8 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
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
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
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,29 @@ | ||
import type { PGliteInterface } from "@electric-sql/pglite"; | ||
import Migration from "../Migration"; | ||
|
||
export default class Functionality_00002 extends Migration { | ||
override async up(db: PGliteInterface): Promise<void> { | ||
const sql = ` | ||
CREATE TABLE cathedral.functionality ( | ||
-- Additional columns can be added here if needed | ||
) | ||
INHERITS (cathedral.behavior); | ||
ALTER TABLE cathedral.functional_behavior INHERIT cathedral.functionality; | ||
ALTER TABLE cathedral.non_functional_behavior INHERIT cathedral.functionality; | ||
` | ||
|
||
await db.exec(sql) | ||
} | ||
override async down(db: PGliteInterface): Promise<void> { | ||
const sql = ` | ||
ALTER TABLE cathedral.functional_behavior NO INHERIT cathedral.behavior; | ||
ALTER TABLE cathedral.non_functional_behavior NO INHERIT cathedral.behavior; | ||
DROP TABLE cathedral.functionality; | ||
` | ||
|
||
await db.exec(sql) | ||
} | ||
|
||
} |
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,6 +1,8 @@ | ||
import Behavior from "./Behavior"; | ||
import Functionality from "./Functionality"; | ||
|
||
/** | ||
* Outcome produced by the system or one of its components | ||
* FunctionalBehavior specifies what behavior the system should exhibit, i.e., | ||
* the actions that the system must perform. | ||
* Generally expressed in the form "system must do <requirement>," | ||
*/ | ||
export default class FunctionalBehavior extends Behavior { } | ||
export default class FunctionalBehavior extends Functionality { } |
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,3 @@ | ||
import Behavior from "./Behavior"; | ||
|
||
export default class Functionality extends Behavior { } |
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,3 +1,8 @@ | ||
import Behavior from "./Behavior"; | ||
import Functionality from "./Functionality"; | ||
|
||
export default class NonFunctionalBehavior extends Behavior { } | ||
/** | ||
* NonFunctionalBehavior is a type of Behavior that is not directly related to the functionality of a system. | ||
* It specifies how the system should behave, i.e., the qualities that the system must exhibit. | ||
* Generally expressed in the form "system shall be <requirement>." | ||
*/ | ||
export default class NonFunctionalBehavior extends Functionality { } |