Skip to content

Commit

Permalink
chore(db): generate migration scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiDood committed Dec 7, 2024
1 parent b994c7e commit fe19dfa
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 0 deletions.
1 change: 1 addition & 0 deletions drizzle/0006_configure-logs-channel.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "app"."channel" ADD COLUMN "log_channel_id" bigint;
258 changes: 258 additions & 0 deletions drizzle/meta/0006_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
{
"id": "e921d4f1-d54a-40f2-ae31-0c25ba36c56c",
"prevId": "db91aadd-056d-4143-bb06-a20facb1fe3f",
"version": "7",
"dialect": "postgresql",
"tables": {
"app.channel": {
"name": "channel",
"schema": "app",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true
},
"guild_id": {
"name": "guild_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"log_channel_id": {
"name": "log_channel_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"disabled_at": {
"name": "disabled_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"color": {
"name": "color",
"type": "bit(24)",
"primaryKey": false,
"notNull": false
},
"is_approval_required": {
"name": "is_approval_required",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'Confession'"
}
},
"indexes": {
"guild_to_channel_unique_idx": {
"name": "guild_to_channel_unique_idx",
"columns": [
{
"expression": "guild_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"channel_guild_id_guild_id_fk": {
"name": "channel_guild_id_guild_id_fk",
"tableFrom": "channel",
"tableTo": "guild",
"schemaTo": "app",
"columnsFrom": [
"guild_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"app.confession": {
"name": "confession",
"schema": "app",
"columns": {
"internal_id": {
"name": "internal_id",
"type": "bigint",
"primaryKey": true,
"notNull": true,
"identity": {
"type": "always",
"name": "confession_internal_id_seq",
"schema": "app",
"increment": "1",
"startWith": "1",
"minValue": "1",
"maxValue": "9223372036854775807",
"cache": "1",
"cycle": false
}
},
"channel_id": {
"name": "channel_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"parent_message_id": {
"name": "parent_message_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"confession_id": {
"name": "confession_id",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"approved_at": {
"name": "approved_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"author_id": {
"name": "author_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"content": {
"name": "content",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"confession_to_channel_unique_idx": {
"name": "confession_to_channel_unique_idx",
"columns": [
{
"expression": "confession_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "channel_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"confession_channel_id_channel_id_fk": {
"name": "confession_channel_id_channel_id_fk",
"tableFrom": "confession",
"tableTo": "channel",
"schemaTo": "app",
"columnsFrom": [
"channel_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"app.guild": {
"name": "guild",
"schema": "app",
"columns": {
"id": {
"name": "id",
"type": "bigint",
"primaryKey": true,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"last_confession_id": {
"name": "last_confession_id",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"default": 0
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {
"app": "app"
},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@
"when": 1733518728927,
"tag": "0005_remove-user-and-guild-cache",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1733593923197,
"tag": "0006_configure-logs-channel",
"breakpoints": true
}
]
}

0 comments on commit fe19dfa

Please sign in to comment.