@zodic/shared 0.0.12 → 0.0.13

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.
@@ -0,0 +1,178 @@
1
+ CREATE TABLE `artifacts` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `name` text NOT NULL,
4
+ `slug` text NOT NULL,
5
+ `concept_id` text NOT NULL,
6
+ `description` text NOT NULL,
7
+ `price` integer NOT NULL,
8
+ `promotion_price` integer,
9
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
10
+ FOREIGN KEY (`concept_id`) REFERENCES `concepts`(`id`) ON UPDATE no action ON DELETE cascade
11
+ );
12
+ --> statement-breakpoint
13
+ CREATE INDEX `artifacts_concept_id_idx` ON `artifacts` (`concept_id`);--> statement-breakpoint
14
+ CREATE TABLE `astro_features` (
15
+ `id` text PRIMARY KEY NOT NULL,
16
+ `user_id` text NOT NULL,
17
+ `feature_type` text NOT NULL,
18
+ `name` text NOT NULL,
19
+ `description` text,
20
+ `percentage` real,
21
+ `order` integer NOT NULL,
22
+ `prominent_id` integer,
23
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
24
+ );
25
+ --> statement-breakpoint
26
+ CREATE INDEX `astro_features_user_id_idx` ON `astro_features` (`user_id`);--> statement-breakpoint
27
+ CREATE TABLE `astro_houses` (
28
+ `id` text PRIMARY KEY NOT NULL,
29
+ `user_id` text NOT NULL,
30
+ `house` integer NOT NULL,
31
+ `sign` text NOT NULL,
32
+ `degree` real NOT NULL,
33
+ `sign_report` text,
34
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
35
+ );
36
+ --> statement-breakpoint
37
+ CREATE INDEX `astro_houses_user_id_idx` ON `astro_houses` (`user_id`);--> statement-breakpoint
38
+ CREATE TABLE `astro_planets` (
39
+ `id` text PRIMARY KEY NOT NULL,
40
+ `user_id` text NOT NULL,
41
+ `type` text NOT NULL,
42
+ `name` text NOT NULL,
43
+ `sign` text NOT NULL,
44
+ `house` integer NOT NULL,
45
+ `full_degree` real,
46
+ `norm_degree` real,
47
+ `speed` real,
48
+ `is_retro` integer,
49
+ `sign_report` text,
50
+ `house_report` text,
51
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
52
+ );
53
+ --> statement-breakpoint
54
+ CREATE INDEX `astro_planets_user_id_idx` ON `astro_planets` (`user_id`);--> statement-breakpoint
55
+ CREATE TABLE `concept_combinations` (
56
+ `id` text PRIMARY KEY NOT NULL,
57
+ `concept_id` text NOT NULL,
58
+ `planet1_sign` text NOT NULL,
59
+ `planet2_sign` text NOT NULL,
60
+ `planet3_sign` text NOT NULL,
61
+ `combination_string` text NOT NULL,
62
+ FOREIGN KEY (`concept_id`) REFERENCES `concepts`(`id`) ON UPDATE no action ON DELETE cascade
63
+ );
64
+ --> statement-breakpoint
65
+ CREATE INDEX `concept_combinations_unique_combination_idx` ON `concept_combinations` (`concept_id`,`combination_string`);--> statement-breakpoint
66
+ CREATE TABLE `concepts` (
67
+ `id` text PRIMARY KEY NOT NULL,
68
+ `name` text NOT NULL,
69
+ `slug` text NOT NULL,
70
+ `planet1` text NOT NULL,
71
+ `planet2` text NOT NULL,
72
+ `planet3` text
73
+ );
74
+ --> statement-breakpoint
75
+ CREATE INDEX `concepts_name_idx` ON `concepts` (`name`);--> statement-breakpoint
76
+ CREATE TABLE `credits_transactions` (
77
+ `id` text PRIMARY KEY NOT NULL,
78
+ `user_id` text NOT NULL,
79
+ `type` text NOT NULL,
80
+ `amount` integer NOT NULL,
81
+ `description` text,
82
+ `product_type` text,
83
+ `product_id` text,
84
+ `payment_id` text,
85
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
86
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
87
+ );
88
+ --> statement-breakpoint
89
+ CREATE INDEX `credits_transactions_user_id_idx` ON `credits_transactions` (`user_id`);--> statement-breakpoint
90
+ CREATE TABLE `generations` (
91
+ `id` text PRIMARY KEY NOT NULL,
92
+ `user_id` text NOT NULL,
93
+ `artifact_id` text,
94
+ `user_artifact_id` text,
95
+ `concept_combination_id` text,
96
+ `type` text NOT NULL,
97
+ `status` text DEFAULT 'pending' NOT NULL,
98
+ `url` text,
99
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
100
+ `updated_at` integer DEFAULT CURRENT_TIMESTAMP,
101
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
102
+ FOREIGN KEY (`artifact_id`) REFERENCES `artifacts`(`id`) ON UPDATE no action ON DELETE cascade,
103
+ FOREIGN KEY (`user_artifact_id`) REFERENCES `user_artifacts`(`id`) ON UPDATE no action ON DELETE cascade,
104
+ FOREIGN KEY (`concept_combination_id`) REFERENCES `concept_combinations`(`id`) ON UPDATE no action ON DELETE cascade
105
+ );
106
+ --> statement-breakpoint
107
+ CREATE INDEX `generations_user_id_idx` ON `generations` (`user_id`);--> statement-breakpoint
108
+ CREATE INDEX `generations_concept_combination_id_idx` ON `generations` (`concept_combination_id`);--> statement-breakpoint
109
+ CREATE TABLE `tokens` (
110
+ `id` text PRIMARY KEY NOT NULL,
111
+ `user_id` text NOT NULL,
112
+ `refresh_token` text NOT NULL,
113
+ `expires_at` text NOT NULL,
114
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
115
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
116
+ );
117
+ --> statement-breakpoint
118
+ CREATE UNIQUE INDEX `tokens_refresh_token_unique` ON `tokens` (`refresh_token`);--> statement-breakpoint
119
+ CREATE INDEX `tokens_user_id_idx` ON `tokens` (`user_id`);--> statement-breakpoint
120
+ CREATE TABLE `user_artifacts` (
121
+ `id` text PRIMARY KEY NOT NULL,
122
+ `user_id` text NOT NULL,
123
+ `artifact_id` text NOT NULL,
124
+ `gender` text NOT NULL,
125
+ `archetype_id` text NOT NULL,
126
+ `post_image_url` text,
127
+ `reel_image_url` text,
128
+ `post_generation_id` text,
129
+ `reel_generation_id` text,
130
+ `status` text DEFAULT 'pending' NOT NULL,
131
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
132
+ `updated_at` integer DEFAULT CURRENT_TIMESTAMP,
133
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
134
+ FOREIGN KEY (`artifact_id`) REFERENCES `artifacts`(`id`) ON UPDATE no action ON DELETE cascade
135
+ );
136
+ --> statement-breakpoint
137
+ CREATE INDEX `user_artifacts_user_id_idx` ON `user_artifacts` (`user_id`);--> statement-breakpoint
138
+ CREATE INDEX `user_artifacts_artifact_id_idx` ON `user_artifacts` (`artifact_id`);--> statement-breakpoint
139
+ CREATE INDEX `user_artifacts_status_idx` ON `user_artifacts` (`status`);--> statement-breakpoint
140
+ CREATE TABLE `user_concepts` (
141
+ `id` text PRIMARY KEY NOT NULL,
142
+ `user_id` text NOT NULL,
143
+ `concept_id` text NOT NULL,
144
+ `concept_combination_id` text NOT NULL,
145
+ `created_at` integer DEFAULT CURRENT_TIMESTAMP,
146
+ `updated_at` integer DEFAULT CURRENT_TIMESTAMP,
147
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
148
+ FOREIGN KEY (`concept_id`) REFERENCES `concepts`(`id`) ON UPDATE no action ON DELETE cascade,
149
+ FOREIGN KEY (`concept_combination_id`) REFERENCES `concept_combinations`(`id`) ON UPDATE no action ON DELETE cascade
150
+ );
151
+ --> statement-breakpoint
152
+ CREATE INDEX `user_concepts_user_id_idx` ON `user_concepts` (`user_id`);--> statement-breakpoint
153
+ CREATE INDEX `user_concepts_concept_id_idx` ON `user_concepts` (`concept_id`);--> statement-breakpoint
154
+ CREATE TABLE `users` (
155
+ `id` text PRIMARY KEY NOT NULL,
156
+ `email` text NOT NULL,
157
+ `name` text NOT NULL,
158
+ `profile_image` text,
159
+ `user_photo_id` text,
160
+ `user_photo_url` text,
161
+ `gender` text,
162
+ `day` integer,
163
+ `month` integer,
164
+ `year` integer,
165
+ `hour` integer,
166
+ `min` integer,
167
+ `latitude` real,
168
+ `longitude` real,
169
+ `tzone` real,
170
+ `instagram_username` text,
171
+ `credits_balance` integer,
172
+ `total_credits_earned` integer DEFAULT 0,
173
+ `last_transaction_at` integer,
174
+ `created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL
175
+ );
176
+ --> statement-breakpoint
177
+ CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
178
+ CREATE INDEX `users_email_idx` ON `users` (`email`);