first commit

This commit is contained in:
bwbl
2026-01-28 14:11:51 +01:00
commit 1cc19b11b6
44 changed files with 10334 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'users'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').notNullable()
table.string('full_name').nullable()
table.string('email', 254).notNullable().unique()
table.string('password').notNullable()
table.timestamp('created_at').notNullable()
table.timestamp('updated_at').nullable()
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}

View File

@@ -0,0 +1,18 @@
import { BaseSchema } from '@adonisjs/lucid/schema'
export default class extends BaseSchema {
protected tableName = 'sections'
async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
table.text('name').notNullable()
table.timestamp('created_at')
table.timestamp('updated_at')
})
}
async down() {
this.schema.dropTable(this.tableName)
}
}

View File

@@ -0,0 +1,21 @@
import { BaseSeeder } from '@adonisjs/lucid/seeders'
import Section from '#models/section'
export default class extends BaseSeeder {
async run() {
await Section.createMany([
{
name: 'Informatique',
},
{
name: 'Mecanique',
},
{
name: 'Electronique',
},
{
name: 'Polymécanique',
},
])
}
}