Added basic comments.
This commit is contained in:
@@ -83,7 +83,7 @@ export async function up(knex) {
|
||||
.notNullable();
|
||||
|
||||
table.text('body');
|
||||
table.text('url');
|
||||
table.text('link');
|
||||
|
||||
table.integer('shelf_id')
|
||||
.notNullable()
|
||||
@@ -100,7 +100,7 @@ export async function up(knex) {
|
||||
.defaultTo(knex.fn.now());
|
||||
});
|
||||
|
||||
await knex.raw('ALTER TABLE posts ADD CONSTRAINT post_content CHECK (body IS NOT NULL OR url IS NOT NULL)');
|
||||
await knex.raw('ALTER TABLE posts ADD CONSTRAINT post_content CHECK (body IS NOT NULL OR link IS NOT NULL)');
|
||||
|
||||
await knex.schema.createTable('comments', (table) => {
|
||||
table.text('id', 8)
|
||||
@@ -112,6 +112,10 @@ export async function up(knex) {
|
||||
.references('id')
|
||||
.inTable('posts');
|
||||
|
||||
table.integer('parent_comment_id')
|
||||
.references('id')
|
||||
.inTable('comments');
|
||||
|
||||
table.integer('user_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
|
||||
Reference in New Issue
Block a user