-
Notifications
You must be signed in to change notification settings - Fork 13
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
4 changed files
with
17 additions
and
0 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,2 @@ | ||
DROP TABLE device_sync_groups; | ||
DROP TABLE device_sync_group_devices; |
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,13 @@ | ||
CREATE TABLE 'device_sync_groups' ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
sync_status VARCHAR(20) NOT NULL DEFAULT 'pending', | ||
sync_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
created_at varchar(255), | ||
updated_at varchar(255) | ||
); | ||
|
||
CREATE TABLE 'device_sync_group_devices' ( | ||
device_sync_group_id INT NOT NULL REFERENCES device_sync_group(id), | ||
device_id INT NOT NULL REFERENCES devices(id), | ||
PRIMARY KEY (device_sync_group_id, device_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 @@ | ||
DROP INDEX IF EXISTS unique_user_id_and_device_name_index; |
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 @@ | ||
CREATE UNIQUE INDEX unique_user_id_and_device_name_index ON devices(user_id, name); |