27 lines
727 B
Go
27 lines
727 B
Go
package common
|
|
|
|
import (
|
|
"zombiezen.com/go/sqlite"
|
|
"zombiezen.com/go/sqlite/sqlitex"
|
|
)
|
|
|
|
// Represents a visual state in the game.
|
|
type VisualState struct {
|
|
ID int64 `db:"id"`
|
|
VisualStateID int32 `db:"visual_state_id"`
|
|
Name string `db:"name"`
|
|
MinClientVersion int16 `db:"min_client_version"`
|
|
}
|
|
|
|
// Creates the visual_states table if it does not exist.
|
|
func CreateVisualStatesTable(conn *sqlite.Conn) error {
|
|
return sqlitex.ExecScript(conn, `
|
|
CREATE TABLE IF NOT EXISTS visual_states (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
visual_state_id INTEGER NOT NULL UNIQUE DEFAULT 0,
|
|
name TEXT NOT NULL DEFAULT 'None',
|
|
min_client_version INTEGER NOT NULL DEFAULT 0
|
|
);
|
|
`)
|
|
}
|