-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Define SQL formatting * Define SQL formatting
- Loading branch information
Showing
14 changed files
with
348 additions
and
280 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,9 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
|
||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": ["bradymholt.pgformatter", "golang.go"], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [] | ||
} |
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 @@ | ||
{ | ||
"pgFormatter.typeCase": "uppercase", | ||
"pgFormatter.tabs": true, | ||
"[sql]": { | ||
"editor.defaultFormatter": "bradymholt.pgformatter" | ||
} | ||
} |
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,5 +1,5 @@ | ||
SET | ||
statement_timeout = 0; | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
DROP TABLE IF EXISTS installations; | ||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
DROP TABLE IF EXISTS messages; | ||
|
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,37 +1,32 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
CREATE TABLE group_messages ( | ||
id BIGSERIAL PRIMARY KEY, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
group_id BYTEA NOT NULL, | ||
data BYTEA NOT NULL, | ||
group_id_data_hash BYTEA NOT NULL | ||
CREATE TABLE group_messages( | ||
id BIGSERIAL PRIMARY KEY, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
group_id BYTEA NOT NULL, | ||
data BYTEA NOT NULL, | ||
group_id_data_hash BYTEA NOT NULL | ||
); | ||
|
||
--bun:split | ||
|
||
CREATE INDEX idx_group_messages_group_id_created_at ON group_messages(group_id, created_at); | ||
|
||
--bun:split | ||
|
||
CREATE UNIQUE INDEX idx_group_messages_group_id_data_hash ON group_messages (group_id_data_hash); | ||
CREATE UNIQUE INDEX idx_group_messages_group_id_data_hash ON group_messages(group_id_data_hash); | ||
|
||
--bun:split | ||
|
||
CREATE TABLE welcome_messages ( | ||
id BIGSERIAL PRIMARY KEY, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
installation_key BYTEA NOT NULL, | ||
data BYTEA NOT NULL, | ||
installation_key_data_hash BYTEA NOT NULL | ||
CREATE TABLE welcome_messages( | ||
id BIGSERIAL PRIMARY KEY, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
installation_key BYTEA NOT NULL, | ||
data BYTEA NOT NULL, | ||
installation_key_data_hash BYTEA NOT NULL | ||
); | ||
|
||
--bun:split | ||
|
||
CREATE INDEX idx_welcome_messages_installation_key_created_at ON welcome_messages(installation_key, created_at); | ||
|
||
--bun:split | ||
CREATE UNIQUE INDEX idx_welcome_messages_group_key_data_hash ON welcome_messages(installation_key_data_hash); | ||
|
||
CREATE UNIQUE INDEX idx_welcome_messages_group_key_data_hash ON welcome_messages (installation_key_data_hash); |
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,4 +1,5 @@ | ||
SET statement_timeout = 0; | ||
|
||
ALTER TABLE welcome_messages | ||
DROP COLUMN IF EXISTS hpke_public_key BYTEA; | ||
DROP COLUMN IF EXISTS hpke_public_key BYTEA; | ||
|
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,4 +1,5 @@ | ||
SET statement_timeout = 0; | ||
|
||
ALTER TABLE welcome_messages | ||
ADD COLUMN hpke_public_key BYTEA; | ||
ADD COLUMN hpke_public_key BYTEA; | ||
|
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,9 +1,8 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
DROP TABLE IF EXISTS inbox_log; | ||
|
||
--bun:split | ||
|
||
DROP TABLE IF EXISTS address_log; | ||
|
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,23 +1,24 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
CREATE TABLE inbox_log ( | ||
sequence_id BIGSERIAL PRIMARY KEY, | ||
inbox_id TEXT NOT NULL, | ||
server_timestamp_ns BIGINT NOT NULL, | ||
identity_update_proto BYTEA NOT NULL | ||
CREATE TABLE inbox_log( | ||
sequence_id BIGSERIAL PRIMARY KEY, | ||
inbox_id TEXT NOT NULL, | ||
server_timestamp_ns BIGINT NOT NULL, | ||
identity_update_proto BYTEA NOT NULL | ||
); | ||
|
||
--bun:split | ||
CREATE INDEX idx_inbox_log_inbox_id ON inbox_log(inbox_id); | ||
|
||
--bun:split | ||
CREATE TABLE address_log ( | ||
address TEXT NOT NULL, | ||
inbox_id TEXT NOT NULL, | ||
association_sequence_id BIGINT, | ||
revocation_sequence_id BIGINT | ||
CREATE TABLE address_log( | ||
address TEXT NOT NULL, | ||
inbox_id TEXT NOT NULL, | ||
association_sequence_id BIGINT, | ||
revocation_sequence_id BIGINT | ||
); | ||
|
||
--bun:split | ||
CREATE INDEX idx_address_log_address_inbox_id ON address_log(address, inbox_id); | ||
CREATE INDEX idx_address_log_address_inbox_id ON address_log(address, inbox_id); | ||
|
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,5 +1,5 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
DROP TYPE IF EXISTS inbox_filter; | ||
|
||
DROP TYPE IF EXISTS inbox_filter; |
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,8 +1,8 @@ | ||
SET statement_timeout = 0; | ||
|
||
--bun:split | ||
|
||
CREATE TYPE inbox_filter AS ( | ||
inbox_id TEXT, | ||
sequence_id BIGINT | ||
inbox_id TEXT, | ||
sequence_id BIGINT | ||
); | ||
|
Oops, something went wrong.