Home page. Empty state component

This commit is contained in:
unknown
2021-09-23 11:31:26 +02:00
parent 956c281a98
commit 02c607ba92
10 changed files with 191 additions and 126 deletions

View File

@@ -1,53 +1,45 @@
import { DataTypes, Model, QueryInterface } from 'sequelize';
import {
Snippet,
SnippetCreationAttributes
} from '../../typescript/interfaces';
import { DataTypes, QueryInterface } from 'sequelize';
const { INTEGER, STRING, DATE, TEXT } = DataTypes;
export const up = async (queryInterface: QueryInterface): Promise<void> => {
await queryInterface.createTable<Model<Snippet, SnippetCreationAttributes>>(
'snippets',
{
id: {
type: INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
title: {
type: STRING,
allowNull: false
},
description: {
type: TEXT,
allowNull: true,
defaultValue: ''
},
language: {
type: STRING,
allowNull: false
},
code: {
type: TEXT,
allowNull: false
},
docs: {
type: TEXT,
allowNull: true,
defaultValue: ''
},
createdAt: {
type: DATE,
allowNull: false
},
updatedAt: {
type: DATE,
allowNull: false
}
await queryInterface.createTable('snippets', {
id: {
type: INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
title: {
type: STRING,
allowNull: false
},
description: {
type: TEXT,
allowNull: true,
defaultValue: ''
},
language: {
type: STRING,
allowNull: false
},
code: {
type: TEXT,
allowNull: false
},
docs: {
type: TEXT,
allowNull: true,
defaultValue: ''
},
createdAt: {
type: DATE,
allowNull: false
},
updatedAt: {
type: DATE,
allowNull: false
}
);
});
};
export const down = async (queryInterface: QueryInterface): Promise<void> => {