Skip to content

Commit 02dd70d

Browse files
committed
Introduce Domain Ownership
1 parent beee0f8 commit 02dd70d

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

documentation.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ bar.com => DeploymentBAR
106106
## **Deployment**
107107
- app_id COMPOSITE
108108
- deploy_id PRIMARY COMPOSITE
109-
- created_on
109+
- timestamp
110+
- sid
111+
- cid
110112

111113
## **Application**
112114
- app_id
113115
- owner_id
116+
- domain_id
114117
- permissions
115118

116119
(app_id, deploy_id)

src/database/migrations.ts

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { domains_create } from './migrations/04_domains_create';
1010
import { deployments_date } from './migrations/05_deployments_date';
1111
import { sites_deprecate } from './migrations/06_sites_deprecate';
1212
import { owner_indexing } from './migrations/07_owner_indexing';
13+
import { domain_ownership } from './migrations/08_domain_ownership';
1314

1415
export type MigrationState = {
1516
instance_id: string;
@@ -87,4 +88,6 @@ export const Migrations: Migration<undefined>[] = [
8788
sites_deprecate,
8889
// Index data types by owner
8990
owner_indexing,
91+
// Alter domain ownership
92+
domain_ownership,
9093
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationV2 } from '../../types/Application.type';
2+
import { Migration } from '../migrations';
3+
4+
export const domain_ownership: Migration<{
5+
applications: ApplicationV2;
6+
}> = async (database) => {
7+
await database.raw('alter table applications add domain_id bigint;');
8+
};

src/types/Application.type.ts

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ export type ApplicationV1 = {
88
[user_id: Snowflake]: PermissionsBit;
99
};
1010
};
11+
12+
export type ApplicationV2 = ApplicationV1 & { domain_id: Snowflake };

0 commit comments

Comments
 (0)