lepisi-pengumuman/App/Models/Post.php

38 lines
1.1 KiB
PHP

<?php
namespace App\Models;
class Post extends \Core\Model
{
public function __construct()
{
// Create table for posts
$this->createTable(
'pengumuman',
[
'id int(3) NOT NULL AUTO_INCREMENT',
'category int(3) NOT NULL',
'created_at date NOT NULL DEFAULT CURRENT_TIMESTAMP',
'valid_at date NOT NULL DEFAULT CURRENT_TIMESTAMP',
'expired_at date NOT NULL',
'creator int(3) NOT NULL',
'edited_at date',
'editor int(3)',
'content varchar(255) NOT NULL',
'status tinyint(1) NOT NULL DEFAULT 1',
'PRIMARY KEY (id)'
]
);
// Create table for categories
$this->createTable(
'kategori',
[
'id int(3) NOT NULL AUTO_INCREMENT',
'category varchar(20) NOT NULL',
'status tinyint(1) NOT NULL DEFAULT 1',
'PRIMARY KEY (id)'
]
);
}
}