forked from safe-global/safe-client-gateway
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
588 changed files
with
31,234 additions
and
4,134 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 |
---|---|---|
@@ -1 +1 @@ | ||
APPLICATION_VERSION=1.52.0 | ||
APPLICATION_VERSION=1.58.0 |
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,3 +1,5 @@ | ||
# .git-blame-ignore-revs | ||
# Change import statement paths to path aliases | ||
4729440761cfe608ab8935d782238ae7fe55343b | ||
# Enfore consistent usage of type imports | ||
9804ceef5bcaa08feebc5ca412834fa04e023d7a |
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,69 @@ | ||
DROP TABLE IF EXISTS push_notification_devices, notification_types, notification_subscriptions, notification_subscription_notification_types CASCADE; | ||
|
||
-------------------------------------------------------- | ||
-- Push notification devices: 'ANDROID', 'IOS', 'WEB' -- | ||
-------------------------------------------------------- | ||
CREATE TABLE push_notification_devices ( | ||
id SERIAL PRIMARY KEY, | ||
device_type VARCHAR(255) CHECK (device_type IN ('ANDROID', 'IOS', 'WEB')) NOT NULL, | ||
device_uuid UUID NOT NULL UNIQUE, | ||
cloud_messaging_token VARCHAR(255) NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() | ||
); | ||
|
||
-- Update updated_at when device is updated to track validity of token | ||
CREATE OR REPLACE TRIGGER update_push_notification_devices_updated_at | ||
BEFORE UPDATE ON push_notification_devices | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_updated_at_column(); | ||
|
||
-------------------------------------------- | ||
-- Notification types, e.g. INCOMING_TOKEN -- | ||
-------------------------------------------- | ||
CREATE TABLE notification_types ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255) NOT NULL UNIQUE | ||
); | ||
|
||
INSERT INTO notification_types (name) VALUES | ||
('CONFIRMATION_REQUEST'), -- PENDING_MULTISIG_TRANSACTION | ||
('DELETED_MULTISIG_TRANSACTION'), | ||
('EXECUTED_MULTISIG_TRANSACTION'), | ||
('INCOMING_ETHER'), | ||
('INCOMING_TOKEN'), | ||
('MESSAGE_CONFIRMATION_REQUEST'), -- MESSAGE_CREATED | ||
('MODULE_TRANSACTION'); | ||
|
||
------------------------------------------- | ||
-- Safe subscriptions for a given device -- | ||
------------------------------------------- | ||
CREATE TABLE notification_subscriptions ( | ||
id SERIAL PRIMARY KEY, | ||
push_notification_device_id INT NOT NULL, | ||
chain_id VARCHAR(255) NOT NULL, | ||
safe_address VARCHAR(42) NOT NULL, | ||
signer_address VARCHAR(42), | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
FOREIGN KEY (push_notification_device_id) REFERENCES push_notification_devices(id) ON DELETE CASCADE, | ||
UNIQUE(chain_id, safe_address, push_notification_device_id, signer_address) | ||
); | ||
|
||
-- Update updated_at when a notification subscription is updated | ||
CREATE OR REPLACE TRIGGER update_notification_subscriptions_updated_at | ||
BEFORE UPDATE ON notification_subscriptions | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_updated_at_column(); | ||
|
||
---------------------------------------------------- | ||
-- Join table for subscription/notification types -- | ||
---------------------------------------------------- | ||
CREATE TABLE notification_subscription_notification_types ( | ||
id SERIAL PRIMARY KEY, | ||
notification_subscription_id INT NOT NULL, | ||
notification_type_id INT NOT NULL, | ||
FOREIGN KEY (notification_subscription_id) REFERENCES notification_subscriptions(id) ON DELETE CASCADE, | ||
FOREIGN KEY (notification_type_id) REFERENCES notification_types(id) ON DELETE CASCADE, | ||
UNIQUE(notification_subscription_id, notification_type_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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
CREATE TABLE outreaches ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255) NOT NULL, | ||
start_date TIMESTAMP WITH TIME ZONE NOT NULL, | ||
end_date TIMESTAMP WITH TIME ZONE NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
CONSTRAINT unique_outreach_name UNIQUE (name) | ||
); | ||
|
||
CREATE OR REPLACE TRIGGER update_outreaches_updated_at | ||
BEFORE UPDATE ON outreaches | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_updated_at_column(); | ||
|
||
CREATE TABLE targeted_safes ( | ||
id SERIAL PRIMARY KEY, | ||
address VARCHAR(42) NOT NULL, | ||
outreach_id INT NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
FOREIGN KEY (outreach_id) REFERENCES outreaches(id) ON DELETE CASCADE, | ||
CONSTRAINT unique_targeted_safe UNIQUE (address, outreach_id) | ||
); | ||
|
||
CREATE OR REPLACE TRIGGER update_targeted_safes_updated_at | ||
BEFORE UPDATE ON targeted_safes | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_updated_at_column(); | ||
|
||
CREATE TABLE submissions ( | ||
id SERIAL PRIMARY KEY, | ||
targeted_safe_id INT NOT NULL, | ||
signer_address VARCHAR(42) NOT NULL, | ||
completion_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | ||
FOREIGN KEY (targeted_safe_id) REFERENCES targeted_safes(id) ON DELETE CASCADE, | ||
CONSTRAINT unique_submission UNIQUE (targeted_safe_id, signer_address) | ||
); | ||
|
||
CREATE OR REPLACE TRIGGER update_submissions_updated_at | ||
BEFORE UPDATE ON submissions | ||
FOR EACH ROW | ||
EXECUTE FUNCTION update_updated_at_column(); |
Oops, something went wrong.