Skip to content

Commit

Permalink
Add books database table migration
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo Correia <[email protected]>
  • Loading branch information
diogotcorreia committed Sep 25, 2020
1 parent 7d7a45e commit 9b11193
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
uses: GabrielBB/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
run: |
yarn package-ci
Expand Down
3 changes: 3 additions & 0 deletions app/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const LazyCounterPage = React.lazy(() =>
import(/* webpackChunkName: "CounterPage" */ './containers/CounterPage')
);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const CounterPage = (props: Record<string, any>) => (
<React.Suspense fallback={<Loading />}>
<LazyCounterPage {...props} />
Expand All @@ -21,6 +22,7 @@ const LazyCustomersPage = React.lazy(() =>
import(/* webpackChunkName: "CustomersPage" */ './containers/CustomersPage')
);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const CustomersPage = (props: Record<string, any>) => (
<React.Suspense fallback={<Loading />}>
<LazyCustomersPage {...props} />
Expand All @@ -31,6 +33,7 @@ const LazyCustomerPage = React.lazy(() =>
import(/* webpackChunkName: "CustomerPage" */ './containers/CustomerPage')
);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const CustomerPage = (props: Record<string, any>) => (
<React.Suspense fallback={<Loading />}>
<LazyCustomerPage {...props} />
Expand Down
14 changes: 14 additions & 0 deletions app/server/migrations/202009251039-books.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Knex from 'knex';

exports.up = (knex: Knex) =>
knex.schema.createTable('books', (table) => {
table.string('isbn', 13).primary();
table.string('name', 255).notNullable();
table.string('publisher', 30);
table.string('provider', 30);
table.string('type', 30).notNullable(); // CA, Manual, Other
table.integer('schoolYear').nullable();
table.string('code_pe', 6).nullable();
});

exports.down = (knex: Knex) => knex.schema.dropTable('books');

0 comments on commit 9b11193

Please sign in to comment.