<commit_before>-- psql -h 127.0.0.1 -U postgres -d RDB2015_DanielMadera -f create-script.sql
-- psql -h 172.16.17.32 -U student -d RDB2015_DanielMadera -f create-script.sql

drop schema if exists "rdb" cascade;
create schema "rdb";
set schema 'rdb';

create table "raw_data" (
    "timestamp" timestamp not null, 
    "unit" character varying(30) not null,
    "location_id" integer not null,
    "longitude" real not null,
    "latitude" real not null, 
    "location_description" character varying(250),
    "value1" real not null,
    "value2" real not null,
    "unit_deviation" real not null,
    "device_sn" character varying(80) not null,
    "device_description" character varying(250),
    "block_id" integer not null,
    "block_description" character varying(250)
);

create table "measurements" (
    "id" serial,
    "timestamp" timestamp not null,
    "value1" real not null,
    "value2" real not null,
    "unit" character varying(30) not null,
    "block_id" integer not null,
    "device_sn" character varying(80) not null
) with (oids=false);

create table "units" (
    "unit" character varying(30) not null,
    "deviation" real not null
) with (oids=false);

create table "devices" (
    "serial_number" character varying(80) not null,
    "description" character varying(250)
) with (oids=false);

create table "blocks" (
    "id" integer not null,
    "description" character varying(250)
) with (oids=false);

create table "locations" (
    "id" integer not null,
    "longitude" real not null,
    "latitude" real not null,
    "description" character varying(250)
) with (oids=false);

alter table "measurements" add constraint "pk_measurements" primary key ("id");
alter table "units" add constraint "pk_units" primary key ("unit");<commit_msg>db: create script minor changes<commit_after>-- psql -h 127.0.0.1 -U postgres -d RDB2015_DanielMadera -f create-script.sql
-- psql -h 172.16.17.32 -U student -d RDB2015_DanielMadera -f create-script.sql

drop schema if exists "rdb" cascade;
create schema "rdb";
set schema 'rdb';

create table "raw_data" (
    "timestamp" timestamp not null, 
    "unit" character varying(30) not null,
    "location_id" integer not null,
    "longitude" real not null,
    "latitude" real not null, 
    "location_description" character varying(250),
    "value1" real not null,
    "value2" real not null,
    "unit_deviation" real not null,
    "device_sn" character varying(80) not null,
    "device_description" character varying(250),
    "block_id" integer not null,
    "block_description" character varying(250)
);

create table "measurements" (
    "id" serial,
    "timestamp" timestamp not null,
    "value1" real not null,
    "value2" real not null,
    "unit" character varying(30) not null,
    "block_id" integer not null,
    "device_sn" character varying(80) not null
) with (oids=false);

create table "units" (
    "unit" character varying(30) not null,
    "deviation" real not null
) with (oids=false);

create table "devices" (
    "serial_number" character varying(80) not null,
    "description" character varying(250)
) with (oids=false);

create table "blocks" (
    "id" integer not null,
    "description" character varying(250)
) with (oids=false);

create table "locations" (
    "id" integer not null,
    "longitude" real not null,
    "latitude" real not null,
    "description" character varying(250)
) with (oids=false);

alter table "raw_data" add constraint "pk_raw_data" primary key ("timestamp", "unit", "location_id", "longitude", "latitude", "location_description", "value1", "value2", "unit_deviation", "device_sn", "device_description", "block_id", "block_description");
alter table "measurements" add constraint "pk_measurements" primary key ("id");
alter table "units" add constraint "pk_units" primary key ("unit");
{'fraction_non_alphanumeric': 0.11940298507462686, 'fraction_numerical': 0.030374443571615607, 'mean_word_length': 4.134408602150538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5962372', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1194, 'n_words': 414}