Skip to content

Commit

Permalink
update tenant id type to a string in db
Browse files Browse the repository at this point in the history
* also allow sending the tenant id in request
  • Loading branch information
imor committed Oct 9, 2024
1 parent 3d11fe7 commit e44f95f
Show file tree
Hide file tree
Showing 44 changed files with 349 additions and 230 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions api/migrations/20241009082351_alter_tenants.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- drop foreign keys
alter table app.sources
drop constraint sources_tenant_id_fkey;

alter table app.sinks
drop constraint sinks_tenant_id_fkey;

alter table app.replicators
drop constraint replicators_tenant_id_fkey;

alter table app.pipelines
drop constraint pipelines_tenant_id_fkey;

-- update tables
alter table app.tenants
drop constraint tenants_pkey;

alter table app.tenants
alter column id
drop identity;

alter table app.tenants
alter column id type text;

alter table app.tenants add primary key (id);

alter table app.sources
alter column tenant_id type text;

alter table app.sinks
alter column tenant_id type text;

alter table app.replicators
alter column tenant_id type text;

alter table app.pipelines
alter column tenant_id type text;

-- add foreign keys
alter table app.sources add constraint sources_tenant_id_fkey foreign key (tenant_id) references app.tenants (id);

alter table app.sinks add constraint sinks_tenant_id_fkey foreign key (tenant_id) references app.tenants (id);

alter table app.replicators add constraint replicators_tenant_id_fkey foreign key (tenant_id) references app.tenants (id);

alter table app.pipelines add constraint pipelines_tenant_id_fkey foreign key (tenant_id) references app.tenants (id);
Loading

0 comments on commit e44f95f

Please sign in to comment.