feat: add published at db models and fix repo for this update
This commit is contained in:
@@ -4,6 +4,7 @@ const Migrations = `
|
||||
CREATE TABLE IF NOT EXISTS posts(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
title TEXT NOT NULL,
|
||||
published BOOLEAN DEFAULT 0,
|
||||
content TEXT NOT NULL,
|
||||
CREATED_AT DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ package storage
|
||||
type Post struct {
|
||||
ID int `db:"id" json:"id"`
|
||||
Title string `db:"title" json:"title"`
|
||||
Published bool `db:"published" json:"published"`
|
||||
Content string `db:"content" json:"content"`
|
||||
CreatedAt string `db:"created_at" json:"created_at"`
|
||||
}
|
||||
@@ -14,8 +15,9 @@ type PostReq struct {
|
||||
}
|
||||
|
||||
type PostCreate struct {
|
||||
Title string `db:"title" json:"title"`
|
||||
Content string `db:"content" json:"content"`
|
||||
Title string `db:"title" json:"title"`
|
||||
Published bool `db:"published" json:"published"`
|
||||
Content string `db:"content" json:"content"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
||||
Reference in New Issue
Block a user