-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added migrations and fixed post install job migration * removed s * bumped version package
- Loading branch information
1 parent
1cb8f80
commit 4df0708
Showing
7 changed files
with
6,012 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
healthcheck/database/migrations/1733857504387_create_users_table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { BaseSchema } from '@adonisjs/lucid/schema' | ||
|
||
export default class extends BaseSchema { | ||
protected tableName = 'users' | ||
|
||
async up() { | ||
this.schema.createTable(this.tableName, (table) => { | ||
table.increments('id') | ||
table.string('username').notNullable() | ||
table.string('email').notNullable() | ||
|
||
table.timestamp('created_at').notNullable() | ||
table.timestamp('updated_at').nullable() | ||
}) | ||
} | ||
|
||
async down() { | ||
this.schema.dropTable(this.tableName) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
healthcheck/database/migrations/1733857630516_create_posts_table.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { BaseSchema } from '@adonisjs/lucid/schema' | ||
|
||
export default class extends BaseSchema { | ||
protected tableName = 'posts' | ||
|
||
async up() { | ||
this.schema.createTable(this.tableName, (table) => { | ||
table.increments('id') | ||
table.integer('user_id').references('id').inTable('users').onDelete('CASCADE').notNullable() | ||
table.string('title').notNullable() | ||
|
||
table.timestamp('created_at').notNullable() | ||
table.timestamp('updated_at').nullable() | ||
}) | ||
} | ||
|
||
async down() { | ||
this.schema.dropTable(this.tableName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.