1
0
forked from MTSR/mapserver
mapserver/server/static/sql/postgres_mapobjectdb_migrate.sql

31 lines
698 B
MySQL
Raw Normal View History

2019-03-21 17:07:09 +03:00
create table if not exists objects(
id serial primary key,
x int,
y int,
z int,
posx int,
posy int,
posz int,
type varchar,
mtime bigint
);
create index if not exists objects_pos on objects(posx,posy,posz);
create index if not exists objects_pos_type on objects(posx,posy,posz,type);
create table if not exists object_attributes(
2019-03-21 17:52:39 +03:00
objectid serial,
2019-03-21 17:07:09 +03:00
key varchar not null,
value varchar not null,
FOREIGN KEY (objectid) references objects(id) ON DELETE CASCADE,
primary key(objectid, key)
);
create index if not exists object_attributes_key_value on object_attributes(key, value);
create table if not exists settings(
key varchar primary key not null,
value varchar not null
);