wip; DRAFT for visibility into changes

Signed-off-by: Billy Stalnaker <bstalnaker@roadie.com>
This commit is contained in:
Billy Stalnaker
2025-03-19 09:28:14 -04:00
parent ad41ba7dc6
commit 5676296812
14 changed files with 304 additions and 63 deletions
@@ -0,0 +1,43 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
exports.up = async function up(knex) {
await knex.schema.alterTable('user_settings', table => {
table.string('topic', 255).nullable().after('origin');
});
await knex.raw(
'ALTER TABLE user_settings DROP CONSTRAINT user_settings_unique_idx',
);
await knex.schema.alterTable('user_settings', table => {
table.unique(['user', 'channel', 'origin', 'topic'], {
indexName: 'user_settings_unique_idx',
});
});
};
exports.down = async function down(knex) {
await knex.raw(
'ALTER TABLE user_settings DROP CONSTRAINT user_settings_unique_idx',
);
await knex.schema.alterTable('user_settings', table => {
table.dropColumn('topic');
table.unique(['user', 'channel', 'origin'], {
indexName: 'user_settings_unique_idx',
});
});
};