aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/db/migration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-14 12:22:53 +0300
committerGravatar Vitaly Takmazov2023-01-14 13:59:24 +0300
commit834fef2a7794d769144c7c087a8b1fa0a2a9bb21 (patch)
treef44d2139be62ed7382c83ff234a557be66a9bde5 /src/main/resources/db/migration
parent456f2a28efc72809c4ac7dd7ee838e0e5b0a061f (diff)
DB: merge ios, android, winphone tables to user_services
Diffstat (limited to 'src/main/resources/db/migration')
-rw-r--r--src/main/resources/db/migration/V1.30__token_type.sql4
-rw-r--r--src/main/resources/db/migration/V1.31__user_services.sql1
-rw-r--r--src/main/resources/db/migration/V1.32__drop_token_tables.sql2
3 files changed, 7 insertions, 0 deletions
diff --git a/src/main/resources/db/migration/V1.30__token_type.sql b/src/main/resources/db/migration/V1.30__token_type.sql
new file mode 100644
index 00000000..601695d8
--- /dev/null
+++ b/src/main/resources/db/migration/V1.30__token_type.sql
@@ -0,0 +1,4 @@
+alter table android add column service_type varchar(255) not null default 'fcm';
+insert into android (user_id, ts, regid, service_type) select user_id, ts, url regid, 'mpns' from winphone;
+insert into android (user_id, ts, regid, service_type) select user_id, ts, token regid, 'apns' from ios;
+
diff --git a/src/main/resources/db/migration/V1.31__user_services.sql b/src/main/resources/db/migration/V1.31__user_services.sql
new file mode 100644
index 00000000..cca1f9dd
--- /dev/null
+++ b/src/main/resources/db/migration/V1.31__user_services.sql
@@ -0,0 +1 @@
+alter table android rename to user_services
diff --git a/src/main/resources/db/migration/V1.32__drop_token_tables.sql b/src/main/resources/db/migration/V1.32__drop_token_tables.sql
new file mode 100644
index 00000000..a1599670
--- /dev/null
+++ b/src/main/resources/db/migration/V1.32__drop_token_tables.sql
@@ -0,0 +1,2 @@
+DROP TABLE ios;
+DROP TABLE winphone