ATC_SIMPLE/BACKEND/database/migrations/1761185386668_create_statio...

36 lines
1.0 KiB
TypeScript

import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'stations'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.string('name').notNullable()
table.string('ip').notNullable()
table.integer('port').notNullable()
table.string('netmask')
table.string('network')
table.string('gateway')
table.string('tftp_ip')
table.string('apc_1_ip')
table.integer('apc_1_port')
table.string('apc_1_username')
table.string('apc_1_password')
table.string('apc_2_ip')
table.integer('apc_2_port')
table.string('apc_2_username')
table.string('apc_2_password')
table.string('switch_control_ip')
table.integer('switch_control_port')
table.string('switch_control_username')
table.string('switch_control_password')
table.timestamps()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}