second draft of the Bazaar plugin

signed-off-by: lykkeaxlin <lykkeaxlin@hotmail.com>

Co-authored-by: klaraab <klarabroman@live.se>
Signed-off-by: Lykke Axlin <lykkeaxlin@hotmail.com>
This commit is contained in:
Lykke Axlin
2021-09-14 13:11:18 +02:00
parent 34fa0b3450
commit eb75e42ce7
66 changed files with 7165 additions and 5574 deletions
@@ -0,0 +1,53 @@
/*
* Copyright 2021 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 setUpTables(knex) {
await knex.schema.createTable('metadata', table => {
table.comment('The table of Bazaar metadata');
table.text('name').notNullable().comment('The name of the entity');
table.text('entity_ref').notNullable().comment('The ref of the entity');
table
.text('announcement')
.notNullable()
.comment('The announcement of the bazaar project');
table
.text('status')
.defaultTo('proposed')
.notNullable()
.comment('The status of the bazaar project');
table
.dateTime('updated_at')
.defaultTo(knex.fn.now())
.notNullable()
.comment('The timestamp when this entry was updated');
});
await knex.schema.createTable('members', table => {
table.comment('The table of Bazaar members');
table.text('entity_ref').notNullable().comment('The ref of the entity');
table.text('user_id').notNullable().comment('The user id of the member');
table
.dateTime('join_date')
.defaultTo(knex.fn.now())
.notNullable()
.comment('The timestamp when this member joined');
});
};
exports.down = async function tearDownTables(knex) {
await knex.schema.dropTable('metadata');
await knex.schema.dropTable('members');
};