diff --git a/app/Controllers/Http/WorkspaceController.ts b/app/Controllers/Http/WorkspaceController.ts index 70af343e..6cc6bee4 100644 --- a/app/Controllers/Http/WorkspaceController.ts +++ b/app/Controllers/Http/WorkspaceController.ts @@ -96,6 +96,7 @@ export default class WorkspaceController { .update({ name: data.name, services: JSON.stringify(data.services), + iconUrl: data.iconUrl, }); // Get updated row @@ -171,6 +172,7 @@ export default class WorkspaceController { workspacesArray = workspaces.map((workspace: any) => ({ id: workspace.workspaceId, name: workspace.name, + iconUrl: workspace.iconUrl, order: workspace.order, services: typeof workspace.services === 'string' diff --git a/app/Models/Workspace.ts b/app/Models/Workspace.ts index 8648e02f..8e8f78d4 100644 --- a/app/Models/Workspace.ts +++ b/app/Models/Workspace.ts @@ -33,6 +33,9 @@ export default class Workspace extends BaseModel { @column() public data: string; + @column() + public iconUrl: string; + @column.dateTime({ autoCreate: true }) public createdAt: DateTime; diff --git a/database/migrations/1707993515903_add_workspace_icon_urls.ts b/database/migrations/1707993515903_add_workspace_icon_urls.ts new file mode 100644 index 00000000..c1d89929 --- /dev/null +++ b/database/migrations/1707993515903_add_workspace_icon_urls.ts @@ -0,0 +1,17 @@ +import BaseSchema from '@ioc:Adonis/Lucid/Schema' + +export default class extends BaseSchema { + protected tableName = 'workspaces' + + public async up () { + this.schema.alterTable(this.tableName, (table) => { + table.string('icon_url').nullable() + }) + } + + public async down () { + this.schema.alterTable(this.tableName, (table) => { + table.dropColumn('icon_url') + }) + } +}