initialized database
This commit is contained in:
parent
dd40016775
commit
0d9e48752d
3
app.lua
3
app.lua
@ -6,6 +6,8 @@ local player = require('player')
|
|||||||
local db = require("lapis.db")
|
local db = require("lapis.db")
|
||||||
local Model = require("lapis.db.model").Model
|
local Model = require("lapis.db.model").Model
|
||||||
|
|
||||||
|
local db = Model:extend('database')
|
||||||
|
|
||||||
app:enable("etlua")
|
app:enable("etlua")
|
||||||
app.layout = require "views.layout"
|
app.layout = require "views.layout"
|
||||||
|
|
||||||
@ -58,5 +60,6 @@ return app
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
database.sqlite3
Normal file
BIN
database.sqlite3
Normal file
Binary file not shown.
24
setup_db
Executable file
24
setup_db
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sqlite3 database.sqlite3 "
|
||||||
|
CREATE TABLE IF NOT EXISTS map (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
x TEXT,
|
||||||
|
y TEXT,
|
||||||
|
occupied_by_type TEXT,
|
||||||
|
occupied_by_id INTEGER
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS entity_ref (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
entity_id INTEGER,
|
||||||
|
type TEXT,
|
||||||
|
hp INTEGER,
|
||||||
|
inventory_ref INTEGER
|
||||||
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS player_inventory (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
type TEXT,
|
||||||
|
quantity INTEGER,
|
||||||
|
func_ref TEXT
|
||||||
|
)
|
||||||
|
"
|
Loading…
Reference in New Issue
Block a user