From 9b9eab0b94e1aa7202226002d8774603677d23ba Mon Sep 17 00:00:00 2001 From: Naz Date: Sat, 8 Feb 2025 11:49:10 +0100 Subject: =?UTF-8?q?=E2=9C=A8feat:=20add=20LSP=20and=20IDEish=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snippets/sql.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 snippets/sql.json (limited to 'snippets/sql.json') diff --git a/snippets/sql.json b/snippets/sql.json new file mode 100644 index 0000000..d191703 --- /dev/null +++ b/snippets/sql.json @@ -0,0 +1,21 @@ +{ + "BaseAuditEntity fields": { + "prefix": "sqlbae", + "body": [ + "-- BaseAuditEntity fields", + "creator INT NOT NULL, -- FK to users.user_id", + "date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,", + "changed_by INT DEFAULT NULL, -- FK to users.user_id", + "date_changed TIMESTAMP DEFAULT NULL,", + "voided BOOLEAN NOT NULL DEFAULT FALSE,", + "voided_by INT DEFAULT NULL, -- FK to users.user_id", + "date_voided TIMESTAMP DEFAULT NULL,", + "void_reason VARCHAR(256) DEFAULT NULL,", + "uuid UUID NOT NULL DEFAULT gen_random_uuid () UNIQUE,", + "CONSTRAINT fk_${0}_creator FOREIGN KEY (creator) REFERENCES users (user_id),", + "CONSTRAINT fk_${0}_changed_by FOREIGN KEY (changed_by) REFERENCES users (user_id),", + "CONSTRAINT fk_${0}_voided_by FOREIGN KEY (voided_by) REFERENCES users (user_id)" + ], + "description": "BaseAuditEntity fields" + } +} -- cgit v1.2.3