25
25
def upgrade () -> None :
26
26
# ### commands auto generated by Alembic - please adjust! ###
27
27
op .create_table (
28
- "client " ,
28
+ "organization " ,
29
29
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
30
30
sa .Column ("slug" , sa .String (length = 64 ), nullable = False ),
31
31
sa .Column ("title" , sa .String (length = 255 ), nullable = False ),
@@ -36,9 +36,9 @@ def upgrade() -> None:
36
36
sa .PrimaryKeyConstraint ("id" ),
37
37
mysql_engine = "InnoDB" ,
38
38
)
39
- op .create_index (op .f ("ix_client_id " ), "client " , ["id" ], unique = True )
40
- op .create_index (op .f ("ix_client_slug " ), "client " , ["slug" ], unique = True )
41
- op .create_index (op .f ("ix_client_title " ), "client " , ["title" ], unique = True )
39
+ op .create_index (op .f ("ix_organization_id " ), "organization " , ["id" ], unique = True )
40
+ op .create_index (op .f ("ix_organization_slug " ), "organization " , ["slug" ], unique = True )
41
+ op .create_index (op .f ("ix_organization_title " ), "organization " , ["title" ], unique = True )
42
42
op .create_table (
43
43
"geocoord" ,
44
44
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
@@ -100,78 +100,78 @@ def upgrade() -> None:
100
100
)
101
101
op .create_index (op .f ("ix_website_id" ), "website" , ["id" ], unique = True )
102
102
op .create_table (
103
- "client_platform " ,
103
+ "organization_platform " ,
104
104
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
105
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
105
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
106
106
sa .Column ("platform_id" , UUIDType (binary = False ), nullable = False ),
107
107
sa .Column ("created" , sa .DateTime (), nullable = False ),
108
108
sa .Column ("updated" , sa .DateTime (), nullable = False ),
109
109
sa .ForeignKeyConstraint (
110
- ["client_id " ],
111
- ["client .id" ],
110
+ ["organization_id " ],
111
+ ["organization .id" ],
112
112
),
113
113
sa .ForeignKeyConstraint (
114
114
["platform_id" ],
115
115
["platform.id" ],
116
116
),
117
- sa .PrimaryKeyConstraint ("client_id " , "platform_id" ),
117
+ sa .PrimaryKeyConstraint ("organization_id " , "platform_id" ),
118
118
)
119
119
op .create_index (
120
- op .f ("ix_client_platform_id " ), "client_platform " , ["id" ], unique = True
120
+ op .f ("ix_organization_platform_id " ), "organization_platform " , ["id" ], unique = True
121
121
)
122
122
op .create_table (
123
- "client_styleguide " ,
123
+ "organization_styleguide " ,
124
124
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
125
125
sa .Column ("title" , sa .String (length = 255 ), nullable = False ),
126
126
sa .Column ("description" , sa .String (length = 5000 ), nullable = True ),
127
127
sa .Column ("styleguide" , JSONType (), nullable = True ),
128
128
sa .Column ("url" , sa .String (length = 2048 ), nullable = True ),
129
129
sa .Column ("is_active" , sa .Boolean (), nullable = False ),
130
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
130
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
131
131
sa .Column ("created" , sa .DateTime (), nullable = False ),
132
132
sa .Column ("updated" , sa .DateTime (), nullable = False ),
133
133
sa .ForeignKeyConstraint (
134
- ["client_id " ],
135
- ["client .id" ],
134
+ ["organization_id " ],
135
+ ["organization .id" ],
136
136
),
137
137
sa .PrimaryKeyConstraint ("id" ),
138
138
mysql_engine = "InnoDB" ,
139
139
)
140
140
op .create_index (
141
- op .f ("ix_client_styleguide_id " ), "client_styleguide " , ["id" ], unique = True
141
+ op .f ("ix_organization_styleguide_id " ), "organization_styleguide " , ["id" ], unique = True
142
142
)
143
143
op .create_index (
144
- op .f ("ix_client_styleguide_title " ), "client_styleguide " , ["title" ], unique = True
144
+ op .f ("ix_organization_styleguide_title " ), "organization_styleguide " , ["title" ], unique = True
145
145
)
146
146
op .create_table (
147
- "client_website " ,
147
+ "organization_website " ,
148
148
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
149
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
149
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
150
150
sa .Column ("website_id" , UUIDType (binary = False ), nullable = False ),
151
151
sa .Column ("created" , sa .DateTime (), nullable = False ),
152
152
sa .Column ("updated" , sa .DateTime (), nullable = False ),
153
153
sa .ForeignKeyConstraint (
154
- ["client_id " ],
155
- ["client .id" ],
154
+ ["organization_id " ],
155
+ ["organization .id" ],
156
156
),
157
157
sa .ForeignKeyConstraint (
158
158
["website_id" ],
159
159
["website.id" ],
160
160
),
161
- sa .PrimaryKeyConstraint ("client_id " , "website_id" ),
161
+ sa .PrimaryKeyConstraint ("organization_id " , "website_id" ),
162
162
)
163
- op .create_index (op .f ("ix_client_website_id " ), "client_website " , ["id" ], unique = True )
163
+ op .create_index (op .f ("ix_organization_website_id " ), "organization_website " , ["id" ], unique = True )
164
164
op .create_table (
165
165
"gcft" ,
166
166
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
167
167
sa .Column ("group_name" , sa .String (length = 255 ), nullable = False ),
168
168
sa .Column ("group_slug" , sa .String (length = 16 ), nullable = False ),
169
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
169
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
170
170
sa .Column ("created" , sa .DateTime (), nullable = False ),
171
171
sa .Column ("updated" , sa .DateTime (), nullable = False ),
172
172
sa .ForeignKeyConstraint (
173
- ["client_id " ],
174
- ["client .id" ],
173
+ ["organization_id " ],
174
+ ["organization .id" ],
175
175
),
176
176
sa .PrimaryKeyConstraint ("id" ),
177
177
mysql_engine = "InnoDB" ,
@@ -185,12 +185,12 @@ def upgrade() -> None:
185
185
sa .Column ("title" , sa .String (length = 255 ), nullable = False ),
186
186
sa .Column ("property_id" , sa .String (length = 16 ), nullable = False ),
187
187
sa .Column ("platform_id" , UUIDType (binary = False ), nullable = False ),
188
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
188
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
189
189
sa .Column ("created" , sa .DateTime (), nullable = False ),
190
190
sa .Column ("updated" , sa .DateTime (), nullable = False ),
191
191
sa .ForeignKeyConstraint (
192
- ["client_id " ],
193
- ["client .id" ],
192
+ ["organization_id " ],
193
+ ["organization .id" ],
194
194
),
195
195
sa .ForeignKeyConstraint (
196
196
["platform_id" ],
@@ -208,12 +208,12 @@ def upgrade() -> None:
208
208
sa .Column ("title" , sa .String (length = 255 ), nullable = False ),
209
209
sa .Column ("measurement_id" , sa .String (length = 16 ), nullable = False ),
210
210
sa .Column ("platform_id" , UUIDType (binary = False ), nullable = False ),
211
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
211
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
212
212
sa .Column ("created" , sa .DateTime (), nullable = False ),
213
213
sa .Column ("updated" , sa .DateTime (), nullable = False ),
214
214
sa .ForeignKeyConstraint (
215
- ["client_id " ],
216
- ["client .id" ],
215
+ ["organization_id " ],
216
+ ["organization .id" ],
217
217
),
218
218
sa .ForeignKeyConstraint (
219
219
["platform_id" ],
@@ -232,13 +232,13 @@ def upgrade() -> None:
232
232
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
233
233
sa .Column ("title" , sa .String (length = 255 ), nullable = False ),
234
234
sa .Column ("platform_id" , UUIDType (binary = False ), nullable = False ),
235
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
235
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
236
236
sa .Column ("website_id" , UUIDType (binary = False ), nullable = False ),
237
237
sa .Column ("created" , sa .DateTime (), nullable = False ),
238
238
sa .Column ("updated" , sa .DateTime (), nullable = False ),
239
239
sa .ForeignKeyConstraint (
240
- ["client_id " ],
241
- ["client .id" ],
240
+ ["organization_id " ],
241
+ ["organization .id" ],
242
242
),
243
243
sa .ForeignKeyConstraint (
244
244
["platform_id" ],
@@ -302,36 +302,36 @@ def upgrade() -> None:
302
302
sa .Column ("utm_content" , sa .String (length = 255 ), nullable = True ),
303
303
sa .Column ("utm_term" , sa .String (length = 255 ), nullable = True ),
304
304
sa .Column ("is_active" , sa .Boolean (), nullable = False ),
305
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = True ),
305
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = True ),
306
306
sa .Column ("created" , sa .DateTime (), nullable = False ),
307
307
sa .Column ("updated" , sa .DateTime (), nullable = False ),
308
308
sa .ForeignKeyConstraint (
309
- ["client_id " ],
310
- ["client .id" ],
309
+ ["organization_id " ],
310
+ ["organization .id" ],
311
311
),
312
312
sa .PrimaryKeyConstraint ("id" ),
313
313
sa .UniqueConstraint ("url_hash" ),
314
314
mysql_engine = "InnoDB" ,
315
315
)
316
316
op .create_index (op .f ("ix_tracking_link_id" ), "tracking_link" , ["id" ], unique = True )
317
317
op .create_table (
318
- "user_client " ,
318
+ "user_organization " ,
319
319
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
320
320
sa .Column ("user_id" , UUIDType (binary = False ), nullable = False ),
321
- sa .Column ("client_id " , UUIDType (binary = False ), nullable = False ),
321
+ sa .Column ("organization_id " , UUIDType (binary = False ), nullable = False ),
322
322
sa .Column ("created" , sa .DateTime (), nullable = False ),
323
323
sa .Column ("updated" , sa .DateTime (), nullable = False ),
324
324
sa .ForeignKeyConstraint (
325
- ["client_id " ],
326
- ["client .id" ],
325
+ ["organization_id " ],
326
+ ["organization .id" ],
327
327
),
328
328
sa .ForeignKeyConstraint (
329
329
["user_id" ],
330
330
["user.id" ],
331
331
),
332
- sa .PrimaryKeyConstraint ("user_id" , "client_id " ),
332
+ sa .PrimaryKeyConstraint ("user_id" , "organization_id " ),
333
333
)
334
- op .create_index (op .f ("ix_user_client_id " ), "user_client " , ["id" ], unique = True )
334
+ op .create_index (op .f ("ix_user_organization_id " ), "user_organization " , ["id" ], unique = True )
335
335
op .create_table (
336
336
"website_page" ,
337
337
sa .Column ("id" , UUIDType (binary = False ), nullable = False ),
@@ -728,8 +728,8 @@ def downgrade() -> None:
728
728
op .drop_index (op .f ("ix_website_page_website_id" ), table_name = "website_page" )
729
729
op .drop_index (op .f ("ix_website_page_id" ), table_name = "website_page" )
730
730
op .drop_table ("website_page" )
731
- op .drop_index (op .f ("ix_user_client_id " ), table_name = "user_client " )
732
- op .drop_table ("user_client " )
731
+ op .drop_index (op .f ("ix_user_organization_id " ), table_name = "user_organization " )
732
+ op .drop_table ("user_organization " )
733
733
op .drop_index (op .f ("ix_tracking_link_id" ), table_name = "tracking_link" )
734
734
op .drop_table ("tracking_link" )
735
735
op .drop_index (op .f ("ix_ipaddress_id" ), table_name = "ipaddress" )
@@ -750,13 +750,13 @@ def downgrade() -> None:
750
750
op .drop_index (op .f ("ix_gcft_group_slug" ), table_name = "gcft" )
751
751
op .drop_index (op .f ("ix_gcft_group_name" ), table_name = "gcft" )
752
752
op .drop_table ("gcft" )
753
- op .drop_index (op .f ("ix_client_website_id " ), table_name = "client_website " )
754
- op .drop_table ("client_website " )
755
- op .drop_index (op .f ("ix_client_styleguide_title " ), table_name = "client_styleguide " )
756
- op .drop_index (op .f ("ix_client_styleguide_id " ), table_name = "client_styleguide " )
757
- op .drop_table ("client_styleguide " )
758
- op .drop_index (op .f ("ix_client_platform_id " ), table_name = "client_platform " )
759
- op .drop_table ("client_platform " )
753
+ op .drop_index (op .f ("ix_organization_website_id " ), table_name = "organization_website " )
754
+ op .drop_table ("organization_website " )
755
+ op .drop_index (op .f ("ix_organization_styleguide_title " ), table_name = "organization_styleguide " )
756
+ op .drop_index (op .f ("ix_organization_styleguide_id " ), table_name = "organization_styleguide " )
757
+ op .drop_table ("organization_styleguide " )
758
+ op .drop_index (op .f ("ix_organization_platform_id " ), table_name = "organization_platform " )
759
+ op .drop_table ("organization_platform " )
760
760
op .drop_index (op .f ("ix_website_id" ), table_name = "website" )
761
761
op .drop_table ("website" )
762
762
op .drop_index (op .f ("ix_user_username" ), table_name = "user" )
@@ -767,8 +767,8 @@ def downgrade() -> None:
767
767
op .drop_index (op .f ("ix_platform_id" ), table_name = "platform" )
768
768
op .drop_table ("platform" )
769
769
op .drop_table ("geocoord" )
770
- op .drop_index (op .f ("ix_client_title " ), table_name = "client " )
771
- op .drop_index (op .f ("ix_client_slug " ), table_name = "client " )
772
- op .drop_index (op .f ("ix_client_id " ), table_name = "client " )
773
- op .drop_table ("client " )
770
+ op .drop_index (op .f ("ix_organization_title " ), table_name = "organization " )
771
+ op .drop_index (op .f ("ix_organization_slug " ), table_name = "organization " )
772
+ op .drop_index (op .f ("ix_organization_id " ), table_name = "organization " )
773
+ op .drop_table ("organization " )
774
774
# ### end Alembic commands ###
0 commit comments