Skip to content

Commit

Permalink
Update returns.lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Cruikshanks committed Feb 19, 2024
1 parent 1a6fd20 commit cf44039
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 deletions.
10 changes: 6 additions & 4 deletions db/migrations/legacy/20230905132524_create-returns-lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ exports.up = function (knex) {

// Data
table.string('version_id').notNullable()
table.string('substance').notNullable()
table.string('substance').notNullable().defaultTo('water')
table.decimal('quantity').notNullable()
table.string('unit').notNullable()
table.string('unit').notNullable().defaultTo('m³')
table.date('start_date').notNullable()
table.date('end_date').notNullable()
table.string('time_period').notNullable()
table.jsonb('metadata')
table.string('reading_type')
table.string('user_unit')

table.unique(['version_id', 'substance', 'start_date', 'end_date'], { useConstraint: true })

// Legacy timestamps
// NOTE: They are not automatically set
table.timestamp('created_at').notNullable()
table.timestamp('updated_at')

// Constraints
table.unique(['version_id', 'substance', 'start_date', 'end_date'], { useConstraint: true })
})
}

Expand Down
23 changes: 0 additions & 23 deletions db/migrations/legacy/20231122183613_add-defaults-to-lines-table.js

This file was deleted.

0 comments on commit cf44039

Please sign in to comment.