mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Creating tables into databases
This commit is contained in:
17
database/migrations/1608409461999_docker_commands.ts
Normal file
17
database/migrations/1608409461999_docker_commands.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class DockerCommands extends BaseSchema {
|
||||
protected tableName = 'docker_commands'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.bigInteger('commands')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
17
database/migrations/1608409468598_docker_builds.ts
Normal file
17
database/migrations/1608409468598_docker_builds.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class DockerBuilds extends BaseSchema {
|
||||
protected tableName = 'docker_builds'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.bigInteger('builds')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
19
database/migrations/1608409476823_locations.ts
Normal file
19
database/migrations/1608409476823_locations.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class Locations extends BaseSchema {
|
||||
protected tableName = 'locations'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.string('place')
|
||||
table.string('left')
|
||||
table.date('since')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
23
database/migrations/1608409618132_deezer_songs.ts
Normal file
23
database/migrations/1608409618132_deezer_songs.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
||||
|
||||
export default class DeezerSongs extends BaseSchema {
|
||||
protected tableName = 'deezer_songs'
|
||||
|
||||
public async up () {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id')
|
||||
table.string('author')
|
||||
table.string('title')
|
||||
table.string('album')
|
||||
table.string('type')
|
||||
table.string('device')
|
||||
table.integer('duration')
|
||||
table.date('release_date')
|
||||
table.timestamps(true)
|
||||
})
|
||||
}
|
||||
|
||||
public async down () {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ Route.get('/', async ({response}: HttpContextContract) => {
|
||||
|
||||
TODO
|
||||
|
||||
Location: get Last + Add location + View history
|
||||
Deezer Songs:
|
||||
|
||||
Tasks: kernel : setTimeout or cron
|
||||
|
||||
Reference in New Issue
Block a user