Add color in skill

This commit is contained in:
2021-08-18 19:49:30 +02:00
parent 52eed07d32
commit 5cc616ee91
4 changed files with 6 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ export default class Skill extends BaseModel {
@column()
public fileId: number
@column()
public color: string
@column.dateTime({ autoCreate: true })
public createdAt: DateTime

View File

@@ -8,6 +8,7 @@ export default class SkillStoreValidator {
public schema = schema.create({
name: schema.string(),
cover: schema.string(),
color: schema.string()
})
public messages = {
required: 'The field {{field}} is required'

View File

@@ -8,6 +8,7 @@ export default class SkillUpdateValidator {
public schema = schema.create({
name: schema.string.optional(),
cover: schema.string.optional(),
color: schema.string.optional()
})
public messages = {

View File

@@ -7,6 +7,7 @@ export default class Skills extends BaseSchema {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('name').notNullable()
table.string('color').notNullable()
table
.integer('file_id')
.unsigned()