diff options
Diffstat (limited to 'app/src/main/assets')
-rw-r--r-- | app/src/main/assets/db/migration/sm/V001.003__new_baseline.sql | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/src/main/assets/db/migration/sm/V001.003__new_baseline.sql b/app/src/main/assets/db/migration/sm/V001.003__new_baseline.sql new file mode 100644 index 0000000..c120b08 --- /dev/null +++ b/app/src/main/assets/db/migration/sm/V001.003__new_baseline.sql @@ -0,0 +1,22 @@ +drop table soil_sample; +drop table soil_monitor; + +create table sm_device( + id integer not null primary key autoincrement, + bt_device integer not null references bt_device(id), + useful boolean +); + +create table sm_sensor( + id integer not null primary key autoincrement, + sm_device integer not null references soil_device(id), + idx integer not null, + constraint uq_sensor_idx unique(sm_device, idx) +); + +create table soil_sample( + id integer not null primary key autoincrement, + sm_sensor integer not null references sm_sensor(id), + timestamp timestamp, + value integer +); |