1
0
EQ2Emu/internal/models/common/appearances.go

27 lines
702 B
Go

package common
import (
"zombiezen.com/go/sqlite"
"zombiezen.com/go/sqlite/sqlitex"
)
// Represents an appearance definition in the game.
type Appearance struct {
ID int64 `db:"id"`
AppearanceID int32 `db:"appearance_id"`
Name string `db:"name"`
MinClientVersion int16 `db:"min_client_version"`
}
// Creates the appearances table if it does not exist.
func CreateAppearancesTable(conn *sqlite.Conn) error {
return sqlitex.ExecScript(conn, `
CREATE TABLE IF NOT EXISTS appearances (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
appearance_id INTEGER NOT NULL UNIQUE,
name TEXT NOT NULL,
min_client_version INTEGER NOT NULL DEFAULT 0
);
`)
}