1575323565424_submissions_schema.js

34 lines | 1.125 kB Blame History Raw Download
'use strict'

/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')

class SubmissionsSchema extends Schema {
  up () {
    this.create('submissions', (table) => {
      table.increments('id')
      table.string('name')
      table.integer('element_id').notNullable().references('id').inTable('elements')
      table.integer('steward_id').notNullable().references('id').inTable('stewards')
      table.date('upload_date').nullable()
      table.date('creation_date').nullable()
      table.date('published_date').nullable()
      table.json('metadata').nullable()
      table.string('local_file_location').nullable()
      table.string('download_file_location').nullable()
      table.string('service_location_ags').nullable()
      table.string('service_location_agol').nullable()
      table.integer('standard_id').references('id').inTable('standards').nullable()
      table.boolean('public').notNullable()
      table.integer('status_id').notNullable().references('id').inTable('submission_statuses')
      table.timestamps()
    })
  }

  down () {
    this.drop('submissions')
  }
}

module.exports = SubmissionsSchema