21 lines
		
	
	
		
			452 B
		
	
	
	
		
			TypeScript
		
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			452 B
		
	
	
	
		
			TypeScript
		
	
	
	
import BaseSchema from "@ioc:Adonis/Lucid/Schema";
 | 
						|
 | 
						|
export default class extends BaseSchema {
 | 
						|
  protected tableName = "info_devices";
 | 
						|
 | 
						|
  public async up() {
 | 
						|
    this.schema.createTable(this.tableName, (table) => {
 | 
						|
      table.increments("id");
 | 
						|
 | 
						|
      /**
 | 
						|
       * Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
 | 
						|
       */
 | 
						|
      table.timestamps(true, true);
 | 
						|
    });
 | 
						|
  }
 | 
						|
 | 
						|
  public async down() {
 | 
						|
    this.schema.dropTable(this.tableName);
 | 
						|
  }
 | 
						|
}
 |