| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- SCHEMA_STATEMENTS = [
- '''
- create table if not exists localities (
- id integer not null primary key,
- name varchar(255) not null
- );
- ''',
- '''
- create table if not exists locality_relationships (
- id varchar(255) not null primary key,
- parent integer not null,
- child integer not null
- )
- ''',
- '''
- create table if not exists search_results (
- id integer not null primary key,
- time datetime not null,
- property_id integer not null,
- price integer not null,
- raw_json text not null
- )
- ''',
- '''
- create table if not exists properties (
- id integer not null primary key,
- last_update datetime not null,
- raw_json text not null
- )
- ''',
- 'alter table properties add column processed tinyint default 0 not null;',
- 'alter table properties add column price integer;',
- 'alter table properties add column lat float;',
- 'alter table properties add column lon float;',
- 'alter table properties add column size;',
- 'alter table properties add column ber varchar(255);',
- 'drop table properties;',
- '''
- create table properties (
- id integer not null primary key,
- last_update datetime not null,
- raw_json text,
- processed tinyint default 0 not null,
- price integer,
- lat float,
- lon float,
- size integer,
- ber varchar(255)
- )
- ''',
- 'alter table properties add column address varchar(1023)',
- 'alter table properties add column locality_id integer',
- 'alter table properties add column property_type varchar(255)',
- 'alter table properties add column bathrooms integer',
- 'alter table properties add column bedrooms integer',
-
- '''
- create table property_locality_map (
- id varchar(255) primary key not null,
- property_id integer not null,
- locality_id integer not null
- )
- ''',
-
- ]
|