@zodic/shared 0.0.99 → 0.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db/migrations/{0000_fearless_dust.sql → 0000_material_lionheart.sql} +23 -3
- package/db/migrations/0001_wild_ironclad.sql +1 -0
- package/db/migrations/meta/0000_snapshot.json +136 -3
- package/db/migrations/meta/0001_snapshot.json +143 -3
- package/db/migrations/meta/_journal.json +4 -53
- package/db/schema.ts +2 -4
- package/package.json +1 -1
- package/db/migrations/0001_known_pretty_boy.sql +0 -20
- package/db/migrations/0002_exotic_maria_hill.sql +0 -2
- package/db/migrations/0003_fearless_giant_girl.sql +0 -5
- package/db/migrations/0004_typical_king_bedlam.sql +0 -12
- package/db/migrations/0005_powerful_meltdown.sql +0 -19
- package/db/migrations/0006_thankful_chimera.sql +0 -22
- package/db/migrations/0007_quick_red_shift.sql +0 -2
- package/db/migrations/0008_rare_liz_osborn.sql +0 -1
- package/db/migrations/meta/0002_snapshot.json +0 -1627
- package/db/migrations/meta/0003_snapshot.json +0 -1663
- package/db/migrations/meta/0004_snapshot.json +0 -1739
- package/db/migrations/meta/0005_snapshot.json +0 -1755
- package/db/migrations/meta/0006_snapshot.json +0 -1753
- package/db/migrations/meta/0007_snapshot.json +0 -1754
- package/db/migrations/meta/0008_snapshot.json +0 -1746
|
@@ -79,7 +79,7 @@ CREATE TABLE `astro_planets` (
|
|
|
79
79
|
`type` text NOT NULL,
|
|
80
80
|
`name` text NOT NULL,
|
|
81
81
|
`sign` text NOT NULL,
|
|
82
|
-
`house` integer
|
|
82
|
+
`house` integer,
|
|
83
83
|
`full_degree` real,
|
|
84
84
|
`norm_degree` real,
|
|
85
85
|
`speed` real,
|
|
@@ -119,7 +119,7 @@ CREATE TABLE `credits_transactions` (
|
|
|
119
119
|
`description` text,
|
|
120
120
|
`product_type` text,
|
|
121
121
|
`product_id` text,
|
|
122
|
-
`payment_id` text,
|
|
122
|
+
`payment_id` text NOT NULL,
|
|
123
123
|
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
124
124
|
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
125
125
|
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
|
@@ -201,6 +201,7 @@ CREATE INDEX `user_concepts_concept_id_idx` ON `user_concepts` (`concept_id`);--
|
|
|
201
201
|
CREATE TABLE `users` (
|
|
202
202
|
`id` text PRIMARY KEY NOT NULL,
|
|
203
203
|
`email` text NOT NULL,
|
|
204
|
+
`password_hash` text,
|
|
204
205
|
`name` text NOT NULL,
|
|
205
206
|
`profile_image` text,
|
|
206
207
|
`user_photo_id` text,
|
|
@@ -216,6 +217,8 @@ CREATE TABLE `users` (
|
|
|
216
217
|
`tzone` real,
|
|
217
218
|
`instagram_username` text,
|
|
218
219
|
`tiktok_username` text,
|
|
220
|
+
`oauth_provider` text,
|
|
221
|
+
`oauth_provider_id` text,
|
|
219
222
|
`credits_balance` integer DEFAULT 0 NOT NULL,
|
|
220
223
|
`total_credits_earned` integer DEFAULT 0 NOT NULL,
|
|
221
224
|
`last_transaction_at` integer,
|
|
@@ -224,4 +227,21 @@ CREATE TABLE `users` (
|
|
|
224
227
|
);
|
|
225
228
|
--> statement-breakpoint
|
|
226
229
|
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
|
|
227
|
-
CREATE INDEX `
|
|
230
|
+
CREATE UNIQUE INDEX `users_instagram_username_unique` ON `users` (`instagram_username`);--> statement-breakpoint
|
|
231
|
+
CREATE UNIQUE INDEX `users_tiktok_username_unique` ON `users` (`tiktok_username`);--> statement-breakpoint
|
|
232
|
+
CREATE UNIQUE INDEX `users_oauth_provider_id_unique` ON `users` (`oauth_provider_id`);--> statement-breakpoint
|
|
233
|
+
CREATE INDEX `users_email_idx` ON `users` (`email`);--> statement-breakpoint
|
|
234
|
+
CREATE INDEX `users_oauth_provider_idx` ON `users` (`oauth_provider`,`oauth_provider_id`);--> statement-breakpoint
|
|
235
|
+
CREATE TABLE `users_temp` (
|
|
236
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
237
|
+
`email` text NOT NULL,
|
|
238
|
+
`name` text NOT NULL,
|
|
239
|
+
`profile_image` text,
|
|
240
|
+
`oauth_provider` text,
|
|
241
|
+
`oauth_provider_id` text,
|
|
242
|
+
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
243
|
+
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
244
|
+
);
|
|
245
|
+
--> statement-breakpoint
|
|
246
|
+
CREATE UNIQUE INDEX `users_temp_email_unique` ON `users_temp` (`email`);--> statement-breakpoint
|
|
247
|
+
CREATE INDEX `users_temp_email_idx` ON `users_temp` (`email`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `users` ADD `birth_location` text NOT NULL;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "6",
|
|
3
3
|
"dialect": "sqlite",
|
|
4
|
-
"id": "
|
|
4
|
+
"id": "ebe194b0-99ee-4e7e-be35-8440074ae3f6",
|
|
5
5
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
6
|
"tables": {
|
|
7
7
|
"artifact_faceswap": {
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
"name": "house",
|
|
560
560
|
"type": "integer",
|
|
561
561
|
"primaryKey": false,
|
|
562
|
-
"notNull":
|
|
562
|
+
"notNull": false,
|
|
563
563
|
"autoincrement": false
|
|
564
564
|
},
|
|
565
565
|
"full_degree": {
|
|
@@ -824,7 +824,7 @@
|
|
|
824
824
|
"name": "payment_id",
|
|
825
825
|
"type": "text",
|
|
826
826
|
"primaryKey": false,
|
|
827
|
-
"notNull":
|
|
827
|
+
"notNull": true,
|
|
828
828
|
"autoincrement": false
|
|
829
829
|
},
|
|
830
830
|
"created_at": {
|
|
@@ -1433,6 +1433,13 @@
|
|
|
1433
1433
|
"notNull": true,
|
|
1434
1434
|
"autoincrement": false
|
|
1435
1435
|
},
|
|
1436
|
+
"password_hash": {
|
|
1437
|
+
"name": "password_hash",
|
|
1438
|
+
"type": "text",
|
|
1439
|
+
"primaryKey": false,
|
|
1440
|
+
"notNull": false,
|
|
1441
|
+
"autoincrement": false
|
|
1442
|
+
},
|
|
1436
1443
|
"name": {
|
|
1437
1444
|
"name": "name",
|
|
1438
1445
|
"type": "text",
|
|
@@ -1538,6 +1545,20 @@
|
|
|
1538
1545
|
"notNull": false,
|
|
1539
1546
|
"autoincrement": false
|
|
1540
1547
|
},
|
|
1548
|
+
"oauth_provider": {
|
|
1549
|
+
"name": "oauth_provider",
|
|
1550
|
+
"type": "text",
|
|
1551
|
+
"primaryKey": false,
|
|
1552
|
+
"notNull": false,
|
|
1553
|
+
"autoincrement": false
|
|
1554
|
+
},
|
|
1555
|
+
"oauth_provider_id": {
|
|
1556
|
+
"name": "oauth_provider_id",
|
|
1557
|
+
"type": "text",
|
|
1558
|
+
"primaryKey": false,
|
|
1559
|
+
"notNull": false,
|
|
1560
|
+
"autoincrement": false
|
|
1561
|
+
},
|
|
1541
1562
|
"credits_balance": {
|
|
1542
1563
|
"name": "credits_balance",
|
|
1543
1564
|
"type": "integer",
|
|
@@ -1586,12 +1607,124 @@
|
|
|
1586
1607
|
],
|
|
1587
1608
|
"isUnique": true
|
|
1588
1609
|
},
|
|
1610
|
+
"users_instagram_username_unique": {
|
|
1611
|
+
"name": "users_instagram_username_unique",
|
|
1612
|
+
"columns": [
|
|
1613
|
+
"instagram_username"
|
|
1614
|
+
],
|
|
1615
|
+
"isUnique": true
|
|
1616
|
+
},
|
|
1617
|
+
"users_tiktok_username_unique": {
|
|
1618
|
+
"name": "users_tiktok_username_unique",
|
|
1619
|
+
"columns": [
|
|
1620
|
+
"tiktok_username"
|
|
1621
|
+
],
|
|
1622
|
+
"isUnique": true
|
|
1623
|
+
},
|
|
1624
|
+
"users_oauth_provider_id_unique": {
|
|
1625
|
+
"name": "users_oauth_provider_id_unique",
|
|
1626
|
+
"columns": [
|
|
1627
|
+
"oauth_provider_id"
|
|
1628
|
+
],
|
|
1629
|
+
"isUnique": true
|
|
1630
|
+
},
|
|
1589
1631
|
"users_email_idx": {
|
|
1590
1632
|
"name": "users_email_idx",
|
|
1591
1633
|
"columns": [
|
|
1592
1634
|
"email"
|
|
1593
1635
|
],
|
|
1594
1636
|
"isUnique": false
|
|
1637
|
+
},
|
|
1638
|
+
"users_oauth_provider_idx": {
|
|
1639
|
+
"name": "users_oauth_provider_idx",
|
|
1640
|
+
"columns": [
|
|
1641
|
+
"oauth_provider",
|
|
1642
|
+
"oauth_provider_id"
|
|
1643
|
+
],
|
|
1644
|
+
"isUnique": false
|
|
1645
|
+
}
|
|
1646
|
+
},
|
|
1647
|
+
"foreignKeys": {},
|
|
1648
|
+
"compositePrimaryKeys": {},
|
|
1649
|
+
"uniqueConstraints": {},
|
|
1650
|
+
"checkConstraints": {}
|
|
1651
|
+
},
|
|
1652
|
+
"users_temp": {
|
|
1653
|
+
"name": "users_temp",
|
|
1654
|
+
"columns": {
|
|
1655
|
+
"id": {
|
|
1656
|
+
"name": "id",
|
|
1657
|
+
"type": "text",
|
|
1658
|
+
"primaryKey": true,
|
|
1659
|
+
"notNull": true,
|
|
1660
|
+
"autoincrement": false
|
|
1661
|
+
},
|
|
1662
|
+
"email": {
|
|
1663
|
+
"name": "email",
|
|
1664
|
+
"type": "text",
|
|
1665
|
+
"primaryKey": false,
|
|
1666
|
+
"notNull": true,
|
|
1667
|
+
"autoincrement": false
|
|
1668
|
+
},
|
|
1669
|
+
"name": {
|
|
1670
|
+
"name": "name",
|
|
1671
|
+
"type": "text",
|
|
1672
|
+
"primaryKey": false,
|
|
1673
|
+
"notNull": true,
|
|
1674
|
+
"autoincrement": false
|
|
1675
|
+
},
|
|
1676
|
+
"profile_image": {
|
|
1677
|
+
"name": "profile_image",
|
|
1678
|
+
"type": "text",
|
|
1679
|
+
"primaryKey": false,
|
|
1680
|
+
"notNull": false,
|
|
1681
|
+
"autoincrement": false
|
|
1682
|
+
},
|
|
1683
|
+
"oauth_provider": {
|
|
1684
|
+
"name": "oauth_provider",
|
|
1685
|
+
"type": "text",
|
|
1686
|
+
"primaryKey": false,
|
|
1687
|
+
"notNull": false,
|
|
1688
|
+
"autoincrement": false
|
|
1689
|
+
},
|
|
1690
|
+
"oauth_provider_id": {
|
|
1691
|
+
"name": "oauth_provider_id",
|
|
1692
|
+
"type": "text",
|
|
1693
|
+
"primaryKey": false,
|
|
1694
|
+
"notNull": false,
|
|
1695
|
+
"autoincrement": false
|
|
1696
|
+
},
|
|
1697
|
+
"created_at": {
|
|
1698
|
+
"name": "created_at",
|
|
1699
|
+
"type": "integer",
|
|
1700
|
+
"primaryKey": false,
|
|
1701
|
+
"notNull": true,
|
|
1702
|
+
"autoincrement": false,
|
|
1703
|
+
"default": "CURRENT_TIMESTAMP"
|
|
1704
|
+
},
|
|
1705
|
+
"updated_at": {
|
|
1706
|
+
"name": "updated_at",
|
|
1707
|
+
"type": "integer",
|
|
1708
|
+
"primaryKey": false,
|
|
1709
|
+
"notNull": true,
|
|
1710
|
+
"autoincrement": false,
|
|
1711
|
+
"default": "CURRENT_TIMESTAMP"
|
|
1712
|
+
}
|
|
1713
|
+
},
|
|
1714
|
+
"indexes": {
|
|
1715
|
+
"users_temp_email_unique": {
|
|
1716
|
+
"name": "users_temp_email_unique",
|
|
1717
|
+
"columns": [
|
|
1718
|
+
"email"
|
|
1719
|
+
],
|
|
1720
|
+
"isUnique": true
|
|
1721
|
+
},
|
|
1722
|
+
"users_temp_email_idx": {
|
|
1723
|
+
"name": "users_temp_email_idx",
|
|
1724
|
+
"columns": [
|
|
1725
|
+
"email"
|
|
1726
|
+
],
|
|
1727
|
+
"isUnique": false
|
|
1595
1728
|
}
|
|
1596
1729
|
},
|
|
1597
1730
|
"foreignKeys": {},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "6",
|
|
3
3
|
"dialect": "sqlite",
|
|
4
|
-
"id": "
|
|
5
|
-
"prevId": "
|
|
4
|
+
"id": "28d34140-d61c-42e8-b826-ce351c86b94e",
|
|
5
|
+
"prevId": "ebe194b0-99ee-4e7e-be35-8440074ae3f6",
|
|
6
6
|
"tables": {
|
|
7
7
|
"artifact_faceswap": {
|
|
8
8
|
"name": "artifact_faceswap",
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
"name": "house",
|
|
560
560
|
"type": "integer",
|
|
561
561
|
"primaryKey": false,
|
|
562
|
-
"notNull":
|
|
562
|
+
"notNull": false,
|
|
563
563
|
"autoincrement": false
|
|
564
564
|
},
|
|
565
565
|
"full_degree": {
|
|
@@ -1433,6 +1433,13 @@
|
|
|
1433
1433
|
"notNull": true,
|
|
1434
1434
|
"autoincrement": false
|
|
1435
1435
|
},
|
|
1436
|
+
"password_hash": {
|
|
1437
|
+
"name": "password_hash",
|
|
1438
|
+
"type": "text",
|
|
1439
|
+
"primaryKey": false,
|
|
1440
|
+
"notNull": false,
|
|
1441
|
+
"autoincrement": false
|
|
1442
|
+
},
|
|
1436
1443
|
"name": {
|
|
1437
1444
|
"name": "name",
|
|
1438
1445
|
"type": "text",
|
|
@@ -1524,6 +1531,13 @@
|
|
|
1524
1531
|
"notNull": false,
|
|
1525
1532
|
"autoincrement": false
|
|
1526
1533
|
},
|
|
1534
|
+
"birth_location": {
|
|
1535
|
+
"name": "birth_location",
|
|
1536
|
+
"type": "text",
|
|
1537
|
+
"primaryKey": false,
|
|
1538
|
+
"notNull": true,
|
|
1539
|
+
"autoincrement": false
|
|
1540
|
+
},
|
|
1527
1541
|
"instagram_username": {
|
|
1528
1542
|
"name": "instagram_username",
|
|
1529
1543
|
"type": "text",
|
|
@@ -1538,6 +1552,20 @@
|
|
|
1538
1552
|
"notNull": false,
|
|
1539
1553
|
"autoincrement": false
|
|
1540
1554
|
},
|
|
1555
|
+
"oauth_provider": {
|
|
1556
|
+
"name": "oauth_provider",
|
|
1557
|
+
"type": "text",
|
|
1558
|
+
"primaryKey": false,
|
|
1559
|
+
"notNull": false,
|
|
1560
|
+
"autoincrement": false
|
|
1561
|
+
},
|
|
1562
|
+
"oauth_provider_id": {
|
|
1563
|
+
"name": "oauth_provider_id",
|
|
1564
|
+
"type": "text",
|
|
1565
|
+
"primaryKey": false,
|
|
1566
|
+
"notNull": false,
|
|
1567
|
+
"autoincrement": false
|
|
1568
|
+
},
|
|
1541
1569
|
"credits_balance": {
|
|
1542
1570
|
"name": "credits_balance",
|
|
1543
1571
|
"type": "integer",
|
|
@@ -1586,12 +1614,124 @@
|
|
|
1586
1614
|
],
|
|
1587
1615
|
"isUnique": true
|
|
1588
1616
|
},
|
|
1617
|
+
"users_instagram_username_unique": {
|
|
1618
|
+
"name": "users_instagram_username_unique",
|
|
1619
|
+
"columns": [
|
|
1620
|
+
"instagram_username"
|
|
1621
|
+
],
|
|
1622
|
+
"isUnique": true
|
|
1623
|
+
},
|
|
1624
|
+
"users_tiktok_username_unique": {
|
|
1625
|
+
"name": "users_tiktok_username_unique",
|
|
1626
|
+
"columns": [
|
|
1627
|
+
"tiktok_username"
|
|
1628
|
+
],
|
|
1629
|
+
"isUnique": true
|
|
1630
|
+
},
|
|
1631
|
+
"users_oauth_provider_id_unique": {
|
|
1632
|
+
"name": "users_oauth_provider_id_unique",
|
|
1633
|
+
"columns": [
|
|
1634
|
+
"oauth_provider_id"
|
|
1635
|
+
],
|
|
1636
|
+
"isUnique": true
|
|
1637
|
+
},
|
|
1589
1638
|
"users_email_idx": {
|
|
1590
1639
|
"name": "users_email_idx",
|
|
1591
1640
|
"columns": [
|
|
1592
1641
|
"email"
|
|
1593
1642
|
],
|
|
1594
1643
|
"isUnique": false
|
|
1644
|
+
},
|
|
1645
|
+
"users_oauth_provider_idx": {
|
|
1646
|
+
"name": "users_oauth_provider_idx",
|
|
1647
|
+
"columns": [
|
|
1648
|
+
"oauth_provider",
|
|
1649
|
+
"oauth_provider_id"
|
|
1650
|
+
],
|
|
1651
|
+
"isUnique": false
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
"foreignKeys": {},
|
|
1655
|
+
"compositePrimaryKeys": {},
|
|
1656
|
+
"uniqueConstraints": {},
|
|
1657
|
+
"checkConstraints": {}
|
|
1658
|
+
},
|
|
1659
|
+
"users_temp": {
|
|
1660
|
+
"name": "users_temp",
|
|
1661
|
+
"columns": {
|
|
1662
|
+
"id": {
|
|
1663
|
+
"name": "id",
|
|
1664
|
+
"type": "text",
|
|
1665
|
+
"primaryKey": true,
|
|
1666
|
+
"notNull": true,
|
|
1667
|
+
"autoincrement": false
|
|
1668
|
+
},
|
|
1669
|
+
"email": {
|
|
1670
|
+
"name": "email",
|
|
1671
|
+
"type": "text",
|
|
1672
|
+
"primaryKey": false,
|
|
1673
|
+
"notNull": true,
|
|
1674
|
+
"autoincrement": false
|
|
1675
|
+
},
|
|
1676
|
+
"name": {
|
|
1677
|
+
"name": "name",
|
|
1678
|
+
"type": "text",
|
|
1679
|
+
"primaryKey": false,
|
|
1680
|
+
"notNull": true,
|
|
1681
|
+
"autoincrement": false
|
|
1682
|
+
},
|
|
1683
|
+
"profile_image": {
|
|
1684
|
+
"name": "profile_image",
|
|
1685
|
+
"type": "text",
|
|
1686
|
+
"primaryKey": false,
|
|
1687
|
+
"notNull": false,
|
|
1688
|
+
"autoincrement": false
|
|
1689
|
+
},
|
|
1690
|
+
"oauth_provider": {
|
|
1691
|
+
"name": "oauth_provider",
|
|
1692
|
+
"type": "text",
|
|
1693
|
+
"primaryKey": false,
|
|
1694
|
+
"notNull": false,
|
|
1695
|
+
"autoincrement": false
|
|
1696
|
+
},
|
|
1697
|
+
"oauth_provider_id": {
|
|
1698
|
+
"name": "oauth_provider_id",
|
|
1699
|
+
"type": "text",
|
|
1700
|
+
"primaryKey": false,
|
|
1701
|
+
"notNull": false,
|
|
1702
|
+
"autoincrement": false
|
|
1703
|
+
},
|
|
1704
|
+
"created_at": {
|
|
1705
|
+
"name": "created_at",
|
|
1706
|
+
"type": "integer",
|
|
1707
|
+
"primaryKey": false,
|
|
1708
|
+
"notNull": true,
|
|
1709
|
+
"autoincrement": false,
|
|
1710
|
+
"default": "CURRENT_TIMESTAMP"
|
|
1711
|
+
},
|
|
1712
|
+
"updated_at": {
|
|
1713
|
+
"name": "updated_at",
|
|
1714
|
+
"type": "integer",
|
|
1715
|
+
"primaryKey": false,
|
|
1716
|
+
"notNull": true,
|
|
1717
|
+
"autoincrement": false,
|
|
1718
|
+
"default": "CURRENT_TIMESTAMP"
|
|
1719
|
+
}
|
|
1720
|
+
},
|
|
1721
|
+
"indexes": {
|
|
1722
|
+
"users_temp_email_unique": {
|
|
1723
|
+
"name": "users_temp_email_unique",
|
|
1724
|
+
"columns": [
|
|
1725
|
+
"email"
|
|
1726
|
+
],
|
|
1727
|
+
"isUnique": true
|
|
1728
|
+
},
|
|
1729
|
+
"users_temp_email_idx": {
|
|
1730
|
+
"name": "users_temp_email_idx",
|
|
1731
|
+
"columns": [
|
|
1732
|
+
"email"
|
|
1733
|
+
],
|
|
1734
|
+
"isUnique": false
|
|
1595
1735
|
}
|
|
1596
1736
|
},
|
|
1597
1737
|
"foreignKeys": {},
|
|
@@ -5,64 +5,15 @@
|
|
|
5
5
|
{
|
|
6
6
|
"idx": 0,
|
|
7
7
|
"version": "6",
|
|
8
|
-
"when":
|
|
9
|
-
"tag": "
|
|
8
|
+
"when": 1738681330421,
|
|
9
|
+
"tag": "0000_material_lionheart",
|
|
10
10
|
"breakpoints": true
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"idx": 1,
|
|
14
14
|
"version": "6",
|
|
15
|
-
"when":
|
|
16
|
-
"tag": "
|
|
17
|
-
"breakpoints": true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"idx": 2,
|
|
21
|
-
"version": "6",
|
|
22
|
-
"when": 1737680017244,
|
|
23
|
-
"tag": "0002_exotic_maria_hill",
|
|
24
|
-
"breakpoints": true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"idx": 3,
|
|
28
|
-
"version": "6",
|
|
29
|
-
"when": 1737680440619,
|
|
30
|
-
"tag": "0003_fearless_giant_girl",
|
|
31
|
-
"breakpoints": true
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"idx": 4,
|
|
35
|
-
"version": "6",
|
|
36
|
-
"when": 1737682853316,
|
|
37
|
-
"tag": "0004_typical_king_bedlam",
|
|
38
|
-
"breakpoints": true
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"idx": 5,
|
|
42
|
-
"version": "6",
|
|
43
|
-
"when": 1737683444742,
|
|
44
|
-
"tag": "0005_powerful_meltdown",
|
|
45
|
-
"breakpoints": true
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"idx": 6,
|
|
49
|
-
"version": "6",
|
|
50
|
-
"when": 1738195592204,
|
|
51
|
-
"tag": "0006_thankful_chimera",
|
|
52
|
-
"breakpoints": true
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"idx": 7,
|
|
56
|
-
"version": "6",
|
|
57
|
-
"when": 1738679864680,
|
|
58
|
-
"tag": "0007_quick_red_shift",
|
|
59
|
-
"breakpoints": true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"idx": 8,
|
|
63
|
-
"version": "6",
|
|
64
|
-
"when": 1738680420813,
|
|
65
|
-
"tag": "0008_rare_liz_osborn",
|
|
15
|
+
"when": 1738686365360,
|
|
16
|
+
"tag": "0001_wild_ironclad",
|
|
66
17
|
"breakpoints": true
|
|
67
18
|
}
|
|
68
19
|
]
|
package/db/schema.ts
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
real,
|
|
6
6
|
sqliteTable,
|
|
7
7
|
text,
|
|
8
|
-
unique,
|
|
9
8
|
} from 'drizzle-orm/sqlite-core';
|
|
10
9
|
|
|
11
10
|
export const timestampFields = {
|
|
@@ -36,6 +35,7 @@ export const users = sqliteTable(
|
|
|
36
35
|
latitude: real('latitude').notNull(),
|
|
37
36
|
longitude: real('longitude').notNull(),
|
|
38
37
|
tzone: real('tzone'), // Nullable for inferred timezone
|
|
38
|
+
birthLocation: text('birth_location').notNull(),
|
|
39
39
|
instagramUsername: text('instagram_username').unique(), // Nullable for optional social media
|
|
40
40
|
tiktokUsername: text('tiktok_username').unique(), // Fix typo
|
|
41
41
|
oauthProvider: text('oauth_provider'), // e.g., "google", "facebook", "apple", nullable for password-based login
|
|
@@ -62,9 +62,7 @@ export const usersTemp = sqliteTable(
|
|
|
62
62
|
oauthProviderId: text('oauth_provider_id'), // Remove .unique()
|
|
63
63
|
...timestampFields,
|
|
64
64
|
},
|
|
65
|
-
(t) => [
|
|
66
|
-
index('users_temp_email_idx').on(t.email),
|
|
67
|
-
]
|
|
65
|
+
(t) => [index('users_temp_email_idx').on(t.email)]
|
|
68
66
|
);
|
|
69
67
|
|
|
70
68
|
export const creditsTransactions = sqliteTable(
|
package/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
-
CREATE TABLE `__new_credits_transactions` (
|
|
3
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
-
`user_id` text NOT NULL,
|
|
5
|
-
`type` text NOT NULL,
|
|
6
|
-
`amount` integer NOT NULL,
|
|
7
|
-
`description` text,
|
|
8
|
-
`product_type` text,
|
|
9
|
-
`product_id` text,
|
|
10
|
-
`payment_id` text NOT NULL,
|
|
11
|
-
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
12
|
-
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
13
|
-
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
|
14
|
-
);
|
|
15
|
-
--> statement-breakpoint
|
|
16
|
-
INSERT INTO `__new_credits_transactions`("id", "user_id", "type", "amount", "description", "product_type", "product_id", "payment_id", "created_at", "updated_at") SELECT "id", "user_id", "type", "amount", "description", "product_type", "product_id", "payment_id", "created_at", "updated_at" FROM `credits_transactions`;--> statement-breakpoint
|
|
17
|
-
DROP TABLE `credits_transactions`;--> statement-breakpoint
|
|
18
|
-
ALTER TABLE `__new_credits_transactions` RENAME TO `credits_transactions`;--> statement-breakpoint
|
|
19
|
-
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
20
|
-
CREATE INDEX `credits_transactions_user_id_idx` ON `credits_transactions` (`user_id`);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
ALTER TABLE `users` ADD `password_hash` text;--> statement-breakpoint
|
|
2
|
-
ALTER TABLE `users` ADD `oauth_provider` text;--> statement-breakpoint
|
|
3
|
-
ALTER TABLE `users` ADD `oauth_provider_id` text;--> statement-breakpoint
|
|
4
|
-
CREATE UNIQUE INDEX `users_oauth_provider_id_unique` ON `users` (`oauth_provider_id`);--> statement-breakpoint
|
|
5
|
-
CREATE INDEX `users_oauth_provider_idx` ON `users` (`oauth_provider`,`oauth_provider_id`);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `users_temp` (
|
|
2
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
-
`email` text NOT NULL,
|
|
4
|
-
`name` text NOT NULL,
|
|
5
|
-
`profile_image` text,
|
|
6
|
-
`provider` text NOT NULL,
|
|
7
|
-
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
8
|
-
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
9
|
-
);
|
|
10
|
-
--> statement-breakpoint
|
|
11
|
-
CREATE UNIQUE INDEX `users_temp_email_unique` ON `users_temp` (`email`);--> statement-breakpoint
|
|
12
|
-
CREATE INDEX `users_temp_email_idx` ON `users_temp` (`email`);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
-
CREATE TABLE `__new_users_temp` (
|
|
3
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
-
`email` text NOT NULL,
|
|
5
|
-
`name` text NOT NULL,
|
|
6
|
-
`profile_image` text,
|
|
7
|
-
`oauth_provider` text,
|
|
8
|
-
`oauth_provider_id` text,
|
|
9
|
-
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
|
10
|
-
`updated_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
11
|
-
);
|
|
12
|
-
--> statement-breakpoint
|
|
13
|
-
INSERT INTO `__new_users_temp`("id", "email", "name", "profile_image", "oauth_provider", "oauth_provider_id", "created_at", "updated_at") SELECT "id", "email", "name", "profile_image", "oauth_provider", "oauth_provider_id", "created_at", "updated_at" FROM `users_temp`;--> statement-breakpoint
|
|
14
|
-
DROP TABLE `users_temp`;--> statement-breakpoint
|
|
15
|
-
ALTER TABLE `__new_users_temp` RENAME TO `users_temp`;--> statement-breakpoint
|
|
16
|
-
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
17
|
-
CREATE UNIQUE INDEX `users_temp_email_unique` ON `users_temp` (`email`);--> statement-breakpoint
|
|
18
|
-
CREATE UNIQUE INDEX `users_temp_oauth_provider_id_unique` ON `users_temp` (`oauth_provider_id`);--> statement-breakpoint
|
|
19
|
-
CREATE INDEX `users_temp_email_idx` ON `users_temp` (`email`);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
|
2
|
-
CREATE TABLE `__new_astro_planets` (
|
|
3
|
-
`id` text PRIMARY KEY NOT NULL,
|
|
4
|
-
`user_id` text NOT NULL,
|
|
5
|
-
`type` text NOT NULL,
|
|
6
|
-
`name` text NOT NULL,
|
|
7
|
-
`sign` text NOT NULL,
|
|
8
|
-
`house` integer,
|
|
9
|
-
`full_degree` real,
|
|
10
|
-
`norm_degree` real,
|
|
11
|
-
`speed` real,
|
|
12
|
-
`is_retro` integer,
|
|
13
|
-
`sign_report` text,
|
|
14
|
-
`house_report` text,
|
|
15
|
-
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
|
16
|
-
);
|
|
17
|
-
--> statement-breakpoint
|
|
18
|
-
INSERT INTO `__new_astro_planets`("id", "user_id", "type", "name", "sign", "house", "full_degree", "norm_degree", "speed", "is_retro", "sign_report", "house_report") SELECT "id", "user_id", "type", "name", "sign", "house", "full_degree", "norm_degree", "speed", "is_retro", "sign_report", "house_report" FROM `astro_planets`;--> statement-breakpoint
|
|
19
|
-
DROP TABLE `astro_planets`;--> statement-breakpoint
|
|
20
|
-
ALTER TABLE `__new_astro_planets` RENAME TO `astro_planets`;--> statement-breakpoint
|
|
21
|
-
PRAGMA foreign_keys=ON;--> statement-breakpoint
|
|
22
|
-
CREATE INDEX `astro_planets_user_id_idx` ON `astro_planets` (`user_id`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
DROP INDEX `users_temp_oauth_provider_oauth_provider_id_unique`;
|