db.js 529 B

123456789101112131415161718192021222324
  1. let init = function(db){
  2. // Create the tables we need to store galleries and files
  3. db.schema.createTableIfNotExists('gallery', function (table) {
  4. table.increments()
  5. table.string('name')
  6. table.timestamps()
  7. }).then(() => {})
  8. db.schema.createTableIfNotExists('files', function (table) {
  9. table.increments()
  10. table.string('file')
  11. table.string('original')
  12. table.string('type')
  13. table.string('size')
  14. table.string('ip')
  15. table.integer('galleryid')
  16. table.timestamps()
  17. }).then(() => {})
  18. }
  19. module.exports = init