1 |
599 |
ahitrov |
create sequence search_id_seq; |
2 |
|
|
select setval('search_id_seq', 1, true); |
3 |
|
|
|
4 |
|
|
create table search |
5 |
|
|
( |
6 |
|
|
id integer not null primary key default nextval('public.search_id_seq'::text), |
7 |
|
|
class text not null, |
8 |
|
|
ctime timestamp not null default now(), |
9 |
|
|
mtime timestamp not null default now(), |
10 |
|
|
status smallint not null default 1, |
11 |
639 |
ahitrov |
is_deleted boolean default false, |
12 |
599 |
ahitrov |
object_id integer not null, |
13 |
|
|
object_class text not null, |
14 |
|
|
name text, |
15 |
|
|
search text, |
16 |
669 |
ahitrov |
data text, |
17 |
|
|
UNIQUE(object_id, object_class) |
18 |
599 |
ahitrov |
); |
19 |
669 |
ahitrov |
create UNIQUE index search_object on search (object_class, object_id); |
20 |
599 |
ahitrov |
create index search_mtime on search (mtime); |