aboutsummaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-06 19:55:27 +0100
committerLibravatar Michal Kostewicz <m.kostewicz84@gmail.com>2021-02-06 19:55:27 +0100
commit21ba7b89c0b185ef1e6878ebd02df21af8c51ed6 (patch)
tree0dd176d1c5c2ccafae3a3904aef8364bf3bf9fb1 /database
parentMerge pull request #44 from xthursdayx/master (diff)
downloadferdium-server-21ba7b89c0b185ef1e6878ebd02df21af8c51ed6.tar.gz
ferdium-server-21ba7b89c0b185ef1e6878ebd02df21af8c51ed6.tar.zst
ferdium-server-21ba7b89c0b185ef1e6878ebd02df21af8c51ed6.zip
Add lastname column to User DB table and update API logic to save,return and update this data.
Diffstat (limited to 'database')
-rw-r--r--database/migrations/1612629845398_users_update_schema.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/database/migrations/1612629845398_users_update_schema.js b/database/migrations/1612629845398_users_update_schema.js
new file mode 100644
index 0000000..d07f66d
--- /dev/null
+++ b/database/migrations/1612629845398_users_update_schema.js
@@ -0,0 +1,20 @@
1'use strict'
2
3/** @type {import('@adonisjs/lucid/src/Schema')} */
4const Schema = use('Schema')
5
6class UsersUpdateSchema extends Schema {
7 up() {
8 this.table('users', (table) => {
9 table.string('lastname', 80).notNullable().default('');
10 })
11 }
12
13 down() {
14 this.table('users', (table) => {
15 table.dropColumn('lastname')
16 })
17 }
18}
19
20module.exports = UsersUpdateSchema \ No newline at end of file