22 lines
		
	
	
		
			587 B
		
	
	
	
		
			TypeScript
		
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			587 B
		
	
	
	
		
			TypeScript
		
	
	
	
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
 | 
						|
 | 
						|
export default class extends BaseSchema {
 | 
						|
  protected tableName = 'log_detect_files'
 | 
						|
 | 
						|
  public async up () {
 | 
						|
    this.schema.createTable(this.tableName, (table) => {
 | 
						|
      table.increments('id_ldf').primary()
 | 
						|
      table.string("file_name", 100).notNullable()
 | 
						|
      /**
 | 
						|
       * Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
 | 
						|
       */
 | 
						|
      table.timestamp('created_at', { useTz: true })
 | 
						|
      table.timestamp('updated_at', { useTz: true })
 | 
						|
    })
 | 
						|
  }
 | 
						|
 | 
						|
  public async down () {
 | 
						|
    this.schema.dropTable(this.tableName)
 | 
						|
  }
 | 
						|
}
 |