1575323565424_submissions_schema.js

34 lines | 1.134 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').notNullable()
      table.date('creation_date').notNullable()
      table.date('published_date').notNullable()
      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