Skip to content

Commit 9a76c40

Browse files
authored
Merge pull request #13 from leachcoding/jay-leach
Fixed some bugs with arrays in knexjs tables and sql
2 parents 6ce1657 + 48155f6 commit 9a76c40

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

database/auth.db3

0 Bytes
Binary file not shown.

database/migrations/20200305182952_create_tables.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ exports.up = function(knex) {
7171
tbl.integer('defense');
7272
tbl.integer('attack');
7373
tbl.integer('hp');
74-
tbl.specificType('abilities', '[]');
75-
tbl.specificType('moves', '[]');
74+
tbl.string('abilities1').notNullable();
75+
tbl.string('abilities2').notNullable();
76+
tbl.string('abilities3').notNullable();
77+
tbl.string('moves1').notNullable();
78+
tbl.string('moves2').notNullable();
79+
tbl.string('moves3').notNullable();
80+
tbl.string('moves4').notNullable();
7681
tbl.integer('user_id')
7782
.unsigned()
7883
.notNullable()

database/seeds/05-pokemon.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
defense: 45,
1616
attack: 49,
1717
hp: 45,
18-
abilities: ['chlorophyll', 'overgrow'],
19-
moves: ['razor-wind', 'swords-dance', 'cut', 'bind'],
18+
abilities1: 'chlorophyll',
19+
abilities2: 'overgrow',
20+
abilities3: '',
21+
moves1: 'razor-wind',
22+
moves2: 'swords-dance',
23+
moves3: 'cut',
24+
moves4: 'bind',
2025
user_id: 1
2126
}
2227
]);

0 commit comments

Comments
 (0)