diff --git a/console_out_test-jobs.txt b/console_out_test-jobs.txt new file mode 100644 index 0000000..c8a8501 --- /dev/null +++ b/console_out_test-jobs.txt @@ -0,0 +1,2392 @@ +=== Setting up WellDrySense Test Suite on Port 1998 === + +---------------------------------------------------------------- +[Test] Login +# Request: +{ + "function": "credentials", + "user_name": "jpeters", + "ps": "WellJson", + "clientId": "bash-suite", + "nonce": "test-nonce" +} + +# Response: +{ + "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "privileges": "64", + "user_id": 68, + "max_role": 2, + "status": "200 OK" +} +PASS (User ID: 68) + +---------------------------------------------------------------- +[Test] job_create +# Request: +{ + "function": "job_create", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "customer_name": "TEST_SUITE_CUSTOMER_BASH", + "address_street": "123 Bash Script Ln", + "address_city": "Shellville", + "devices": "[{\"mac\": \"TEST_MAC_VIRTUAL\", \"location\": \"Lab\"}]", + "lat": "34.05", + "lng": "-118.25" +} + +# Response: +{ + "ok": 1, + "job_id": 9, + "status": "200 OK" +} +PASS +-> Captured Job ID: 9 + +---------------------------------------------------------------- +[Test] job_list +# Request: +{ + "function": "job_list", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs" +} + +# Response: +{ + "ok": 1, + "jobs": [ + { + "job_id": 9, + "customer_name": "TEST_SUITE_CUSTOMER_BASH", + "address": "123 Bash Script Ln, Shellville", + "date_from": "2025-11-22T20:44:25.484569-08:00", + "job_status": "Active", + "mitigation_person": "Jason Peters" + }, + { + "job_id": 5, + "customer_name": "Test Job No Devices", + "address": "100 Example St, Demo City", + "date_from": "2025-11-22T02:58:15.989487-08:00", + "job_status": "Active", + "mitigation_person": "Jason Peters" + }, + { + "job_id": 6, + "customer_name": "Test Job No. 2", + "address": "105 Other St, Better City", + "date_from": "2025-11-22T06:23:09.902552-08:00", + "job_status": "Stopped", + "mitigation_person": "Jason Peters" + } + ], + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] job_details +# Request: +{ + "function": "job_details", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "job_id": "9" +} + +# Response: +{ + "ok": 1, + "details": { + "job_id": 9, + "customer_name": "TEST_SUITE_CUSTOMER_BASH", + "mitigation_person_id": 68, + "key_person_name": null, + "key_person_mobile": null, + "key_person_email": null, + "address_street": "123 Bash Script Ln", + "address_city": "Shellville", + "address_zip": null, + "address_state": null, + "address_country": null, + "lat": 34.05, + "lng": -118.25, + "date_from": "2025-11-22T20:44:25.484569-08:00", + "date_to": null, + "job_status": "Active", + "devices": "[{\"mac\": \"TEST_MAC_VIRTUAL\", \"location\": \"Lab\"}]", + "alerts_config": {}, + "created_at": "2025-11-22T20:44:25.484569-08:00", + "user_edit": 68 + }, + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] job_edit +# Request: +{ + "function": "job_edit", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "job_id": "9", + "job_status": "Stopped", + "date_to": "2025-12-31T23:59:59" +} + +# Response: +{ + "ok": 1, + "job_id": "9", + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] job_available_devices +# Request: +{ + "function": "job_available_devices", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs" +} + +# Response: +{ + "ok": 1, + "devices": [ + { + "device_id": 770, + "well_id": 524, + "device_mac": "142B2F81A2CC", + "description": "initial" + }, + { + "device_id": 771, + "well_id": 525, + "device_mac": "901506CA3A64", + "description": "initial" + }, + { + "device_id": 780, + "well_id": 533, + "device_mac": "10061C15C358", + "description": "initial" + }, + { + "device_id": 786, + "well_id": 538, + "device_mac": "142B2F81A12C", + "description": "initial" + }, + { + "device_id": 772, + "well_id": 526, + "device_mac": "10061C15C304", + "description": "initial" + }, + { + "device_id": 781, + "well_id": 534, + "device_mac": "142B2F81AA88", + "description": "initial" + }, + { + "device_id": 783, + "well_id": 535, + "device_mac": "142B2F81AA8C", + "description": "initial" + }, + { + "device_id": 773, + "well_id": 527, + "device_mac": "10061C15C234", + "description": "initial" + }, + { + "device_id": 784, + "well_id": 536, + "device_mac": "142B2F81A690", + "description": "initial" + }, + { + "device_id": 788, + "well_id": 540, + "device_mac": "142B2F81AA68", + "description": "initial" + }, + { + "device_id": 798, + "well_id": 549, + "device_mac": "901506CA3C24", + "description": "initial" + }, + { + "device_id": 496, + "well_id": 201, + "device_mac": "64B708890584", + "description": "" + }, + { + "device_id": 500, + "well_id": 205, + "device_mac": "64B708897018", + "description": "" + }, + { + "device_id": 505, + "well_id": 210, + "device_mac": "64B708890A38", + "description": "" + }, + { + "device_id": 498, + "well_id": 203, + "device_mac": "64B708890B14", + "description": "" + }, + { + "device_id": 703, + "well_id": 460, + "device_mac": "10061C159AA0", + "description": "" + }, + { + "device_id": 639, + "well_id": 407, + "device_mac": "901506CA3CFC", + "description": "" + }, + { + "device_id": 768, + "well_id": 522, + "device_mac": "142B2F81A688", + "description": "initial" + }, + { + "device_id": 785, + "well_id": 537, + "device_mac": "142B2F819F24", + "description": "initial" + }, + { + "device_id": 544, + "well_id": 251, + "device_mac": "64B7088909E8", + "description": "" + }, + { + "device_id": 546, + "well_id": 252, + "device_mac": "64B708890734", + "description": "" + }, + { + "device_id": 789, + "well_id": 541, + "device_mac": "142B2F819E18", + "description": "initial" + }, + { + "device_id": 792, + "well_id": 544, + "device_mac": "10061C15C21C", + "description": "initial" + }, + { + "device_id": 664, + "well_id": 432, + "device_mac": "10061C15C364", + "description": "initial" + }, + { + "device_id": 750, + "well_id": 504, + "device_mac": "142B2F81A3D8", + "description": "initial" + }, + { + "device_id": 643, + "well_id": 411, + "device_mac": "901506CA3CF8", + "description": "" + }, + { + "device_id": 662, + "well_id": 430, + "device_mac": "142B2F81AA6C", + "description": "" + }, + { + "device_id": 734, + "well_id": 488, + "device_mac": "10061C15C33C", + "description": "initial" + }, + { + "device_id": 758, + "well_id": 512, + "device_mac": "10061C159A9C", + "description": "initial" + }, + { + "device_id": 550, + "well_id": 257, + "device_mac": "64B708890248", + "description": null + }, + { + "device_id": 553, + "well_id": 260, + "device_mac": "64B708897074", + "description": null + }, + { + "device_id": 742, + "well_id": 496, + "device_mac": "901506CA3BAC", + "description": "initial" + }, + { + "device_id": 743, + "well_id": 497, + "device_mac": "142B2F81A14C", + "description": "initial" + }, + { + "device_id": 769, + "well_id": 523, + "device_mac": "142B2F81AAD4", + "description": "initial" + }, + { + "device_id": 357, + "well_id": 101, + "device_mac": "64B7088902B8", + "description": "null" + }, + { + "device_id": 358, + "well_id": 102, + "device_mac": "308398C72E58", + "description": "" + }, + { + "device_id": 359, + "well_id": 103, + "device_mac": "64B708896BD8", + "description": "" + }, + { + "device_id": 360, + "well_id": 104, + "device_mac": "64B708890988", + "description": "null" + }, + { + "device_id": 362, + "well_id": 106, + "device_mac": "64B708890298", + "description": "null" + }, + { + "device_id": 363, + "well_id": 107, + "device_mac": "4C75259783E0", + "description": "Malo " + }, + { + "device_id": 386, + "well_id": 130, + "device_mac": "64B7088905C8", + "description": "null" + }, + { + "device_id": 774, + "well_id": 528, + "device_mac": "901506CA42A8", + "description": "initial" + }, + { + "device_id": 499, + "well_id": 204, + "device_mac": "64B708890288", + "description": "" + }, + { + "device_id": 497, + "well_id": 202, + "device_mac": "64B7088906D8", + "description": "" + }, + { + "device_id": 704, + "well_id": 461, + "device_mac": "142B2F81A5B0", + "description": "" + }, + { + "device_id": 790, + "well_id": 542, + "device_mac": "10061C15C350", + "description": "initial" + }, + { + "device_id": 793, + "well_id": 545, + "device_mac": "10061C15C37C", + "description": "initial" + }, + { + "device_id": 669, + "well_id": 437, + "device_mac": "10061C15C218", + "description": "" + }, + { + "device_id": 652, + "well_id": 420, + "device_mac": "326638316134", + "description": "" + }, + { + "device_id": 748, + "well_id": 502, + "device_mac": "901506CA4700", + "description": "initial" + }, + { + "device_id": 660, + "well_id": 428, + "device_mac": "901506CA3CB8", + "description": "" + }, + { + "device_id": 661, + "well_id": 429, + "device_mac": "142B2F81AA64", + "description": "" + }, + { + "device_id": 571, + "well_id": 291, + "device_mac": "64B70888FA84", + "description": null + }, + { + "device_id": 666, + "well_id": 434, + "device_mac": "142B2F81A290", + "description": "initial" + }, + { + "device_id": 670, + "well_id": 438, + "device_mac": "142B2F81AAAC", + "description": "" + }, + { + "device_id": 675, + "well_id": 441, + "device_mac": "10061C15C278", + "description": "" + }, + { + "device_id": 677, + "well_id": 442, + "device_mac": "10061C159A0C", + "description": "" + }, + { + "device_id": 761, + "well_id": 515, + "device_mac": "142B2F81A4B0", + "description": "initial" + }, + { + "device_id": 689, + "well_id": 450, + "device_mac": "142B2F81A2A4", + "description": "" + }, + { + "device_id": 730, + "well_id": 484, + "device_mac": "10061C15C26C", + "description": "initial" + }, + { + "device_id": 724, + "well_id": 478, + "device_mac": "10061C1599AC", + "description": "initial" + }, + { + "device_id": 759, + "well_id": 513, + "device_mac": "142B2F81A67C", + "description": "initial" + }, + { + "device_id": 764, + "well_id": 518, + "device_mac": "10061C15C25C", + "description": "initial" + }, + { + "device_id": 763, + "well_id": 517, + "device_mac": "142B2F81A124", + "description": "initial" + }, + { + "device_id": 318, + "well_id": 37, + "device_mac": "98CDACD07240", + "description": "" + }, + { + "device_id": 319, + "well_id": 30, + "device_mac": "308398E05658", + "description": "" + }, + { + "device_id": 594, + "well_id": 296, + "device_mac": "4267426B7477", + "description": "" + }, + { + "device_id": 636, + "well_id": 404, + "device_mac": "10061C159A84", + "description": "" + }, + { + "device_id": 775, + "well_id": 529, + "device_mac": "142B2F819E10", + "description": "initial" + }, + { + "device_id": 640, + "well_id": 408, + "device_mac": "142B2F81A3E4", + "description": "" + }, + { + "device_id": 645, + "well_id": 413, + "device_mac": "202020202022", + "description": "" + }, + { + "device_id": 667, + "well_id": 435, + "device_mac": "142B2F81A4F8", + "description": "" + }, + { + "device_id": 791, + "well_id": 543, + "device_mac": "901506CA3BC8", + "description": "initial" + }, + { + "device_id": 741, + "well_id": 495, + "device_mac": "142B2F81A128", + "description": "initial" + }, + { + "device_id": 731, + "well_id": 485, + "device_mac": "142B2F819F74", + "description": "initial" + }, + { + "device_id": 710, + "well_id": 467, + "device_mac": "316331353961", + "description": "" + }, + { + "device_id": 762, + "well_id": 516, + "device_mac": "10061C15C32C", + "description": "initial" + }, + { + "device_id": 794, + "well_id": 546, + "device_mac": "10061C15C258", + "description": "initial" + }, + { + "device_id": 749, + "well_id": 503, + "device_mac": "10061C15C320", + "description": "initial" + }, + { + "device_id": 737, + "well_id": 491, + "device_mac": "10061C15C378", + "description": "initial" + }, + { + "device_id": 757, + "well_id": 511, + "device_mac": "142B2F81A160", + "description": "initial" + }, + { + "device_id": 744, + "well_id": 498, + "device_mac": "901506CA3DD0", + "description": "initial" + }, + { + "device_id": 728, + "well_id": 482, + "device_mac": "10061C159A10", + "description": "" + }, + { + "device_id": 296, + "well_id": 51, + "device_mac": "5002919DF284", + "description": "" + }, + { + "device_id": 297, + "well_id": 50, + "device_mac": "308398C717DC", + "description": "" + }, + { + "device_id": 298, + "well_id": 5, + "device_mac": "308398E056AC", + "description": "Small Bathroom" + }, + { + "device_id": 299, + "well_id": 38, + "device_mac": "308398C7245C", + "description": "Eye Tech" + }, + { + "device_id": 300, + "well_id": 35, + "device_mac": "308398C722F0", + "description": "" + }, + { + "device_id": 562, + "well_id": 269, + "device_mac": "64B708897428", + "description": "" + }, + { + "device_id": 559, + "well_id": 266, + "device_mac": "64B70888FAB0", + "description": "Small" + }, + { + "device_id": 524, + "well_id": 273, + "device_mac": "64B708896BDC", + "description": null + }, + { + "device_id": 560, + "well_id": 267, + "device_mac": "64B70888F6F0", + "description": "" + }, + { + "device_id": 705, + "well_id": 462, + "device_mac": "142B2F81A5AC", + "description": "Novi 462" + }, + { + "device_id": 641, + "well_id": 409, + "device_mac": "142B2F81A2D4", + "description": "" + }, + { + "device_id": 637, + "well_id": 405, + "device_mac": "303663613363", + "description": "" + }, + { + "device_id": 795, + "well_id": 547, + "device_mac": "901506CA4320", + "description": "initial" + }, + { + "device_id": 657, + "well_id": 425, + "device_mac": "142B2F81AA60", + "description": "initial" + }, + { + "device_id": 725, + "well_id": 479, + "device_mac": "142B2F819F78", + "description": "initial" + }, + { + "device_id": 732, + "well_id": 486, + "device_mac": "142B2F81A434", + "description": "initial" + }, + { + "device_id": 747, + "well_id": 501, + "device_mac": "10061C1599B0", + "description": "initial" + }, + { + "device_id": 711, + "well_id": 468, + "device_mac": "10061C159A30", + "description": "" + }, + { + "device_id": 561, + "well_id": 268, + "device_mac": "64B70889062C", + "description": null + }, + { + "device_id": 678, + "well_id": 443, + "device_mac": "10061C15C310", + "description": "initial" + }, + { + "device_id": 572, + "well_id": 290, + "device_mac": "64B70888F860", + "description": "" + }, + { + "device_id": 638, + "well_id": 406, + "device_mac": "10061C15C398", + "description": "" + }, + { + "device_id": 721, + "well_id": 476, + "device_mac": "901506CA3CE8", + "description": "" + }, + { + "device_id": 738, + "well_id": 492, + "device_mac": "901506CA3CC4", + "description": "" + }, + { + "device_id": 713, + "well_id": 469, + "device_mac": "142B2F81AAA8", + "description": "" + }, + { + "device_id": 646, + "well_id": 414, + "device_mac": "303663613362", + "description": "" + }, + { + "device_id": 672, + "well_id": 439, + "device_mac": "142B2F819F6C", + "description": "" + }, + { + "device_id": 674, + "well_id": 440, + "device_mac": "901506CA4070", + "description": "" + }, + { + "device_id": 564, + "well_id": 235, + "device_mac": "64B708890A68", + "description": "Yulic" + }, + { + "device_id": 642, + "well_id": 410, + "device_mac": "142B2F819FA0", + "description": "" + }, + { + "device_id": 797, + "well_id": 548, + "device_mac": "142B2F81A4D4", + "description": "initial" + }, + { + "device_id": 647, + "well_id": 415, + "device_mac": "303663613364", + "description": "" + }, + { + "device_id": 649, + "well_id": 417, + "device_mac": "316331353962", + "description": "" + }, + { + "device_id": 745, + "well_id": 499, + "device_mac": "142B2F81A2B8", + "description": "initial" + }, + { + "device_id": 766, + "well_id": 520, + "device_mac": "10061C15C29C", + "description": "initial" + }, + { + "device_id": 733, + "well_id": 487, + "device_mac": "142B2F819E34", + "description": "initial" + }, + { + "device_id": 760, + "well_id": 514, + "device_mac": "10061C159B0C", + "description": "initial" + }, + { + "device_id": 301, + "well_id": 13, + "device_mac": "308398C721E4", + "description": "" + }, + { + "device_id": 302, + "well_id": 3, + "device_mac": "308398C72CDC", + "description": "" + }, + { + "device_id": 303, + "well_id": 9, + "device_mac": "308398C721F4", + "description": "" + }, + { + "device_id": 304, + "well_id": 17, + "device_mac": "308398E05724", + "description": null + }, + { + "device_id": 305, + "well_id": 0, + "device_mac": "DE2F6273361B", + "description": null + }, + { + "device_id": 306, + "well_id": 41, + "device_mac": "308398E055C8", + "description": "ET-B4" + }, + { + "device_id": 307, + "well_id": 39, + "device_mac": "308398C71C84", + "description": "" + }, + { + "device_id": 308, + "well_id": 29, + "device_mac": "308398E055CC", + "description": "" + }, + { + "device_id": 483, + "well_id": 0, + "device_mac": "AB1173AB173C", + "description": null + }, + { + "device_id": 729, + "well_id": 483, + "device_mac": "10061C15C264", + "description": "" + }, + { + "device_id": 665, + "well_id": 433, + "device_mac": "142B2F81A020", + "description": "office temp" + }, + { + "device_id": 534, + "well_id": 236, + "device_mac": "64B708890F2C", + "description": "" + }, + { + "device_id": 746, + "well_id": 500, + "device_mac": "10061C15C340", + "description": "initial" + }, + { + "device_id": 765, + "well_id": 519, + "device_mac": "10061C159AB0", + "description": "initial" + }, + { + "device_id": 630, + "well_id": 400, + "device_mac": "901506CA3C7C", + "description": "initial" + }, + { + "device_id": 631, + "well_id": 401, + "device_mac": "142B2F81A104", + "description": "ok" + }, + { + "device_id": 632, + "well_id": 402, + "device_mac": "901506CA3BDC", + "description": "ok" + }, + { + "device_id": 726, + "well_id": 480, + "device_mac": "142B2F81AAD0", + "description": "initial" + }, + { + "device_id": 756, + "well_id": 510, + "device_mac": "10061C159B08", + "description": "initial" + }, + { + "device_id": 648, + "well_id": 416, + "device_mac": "10061C159B2C", + "description": "ok" + }, + { + "device_id": 655, + "well_id": 423, + "device_mac": "142B2F819E5C", + "description": "" + }, + { + "device_id": 668, + "well_id": 436, + "device_mac": "10061C1599C0", + "description": "" + }, + { + "device_id": 735, + "well_id": 489, + "device_mac": "10061C15C268", + "description": "initial" + }, + { + "device_id": 740, + "well_id": 494, + "device_mac": "142B2F819F54", + "description": "" + }, + { + "device_id": 767, + "well_id": 521, + "device_mac": "142B2F81A69C", + "description": "initial" + }, + { + "device_id": 309, + "well_id": 43, + "device_mac": "308398DF2FFC", + "description": "ET-B4" + }, + { + "device_id": 310, + "well_id": 20, + "device_mac": "308398C718E0", + "description": "Kitchen" + }, + { + "device_id": 311, + "well_id": 24, + "device_mac": "308398C71738", + "description": "" + }, + { + "device_id": 312, + "well_id": 36, + "device_mac": "308398DF3104", + "description": null + }, + { + "device_id": 313, + "well_id": 45, + "device_mac": "308398C727AC", + "description": "ET-B4" + }, + { + "device_id": 314, + "well_id": 26, + "device_mac": "308398E056A4", + "description": "" + }, + { + "device_id": 315, + "well_id": 23, + "device_mac": "308398DF2EDC", + "description": "" + }, + { + "device_id": 316, + "well_id": 14, + "device_mac": "308398C724FC", + "description": "U kuhinji" + }, + { + "device_id": 317, + "well_id": 42, + "device_mac": "308398C71B04", + "description": "" + }, + { + "device_id": 484, + "well_id": 0, + "device_mac": "CC70C4CD7937", + "description": null + }, + { + "device_id": 320, + "well_id": 1, + "device_mac": "308398DF3118", + "description": "Eye Tech" + }, + { + "device_id": 321, + "well_id": 2, + "device_mac": "308398DF2FC8", + "description": "ET-RB" + }, + { + "device_id": 322, + "well_id": 12, + "device_mac": "308398DF2F54", + "description": "Office" + }, + { + "device_id": 323, + "well_id": 15, + "device_mac": "308398C72754", + "description": "" + }, + { + "device_id": 324, + "well_id": 22, + "device_mac": "308398E05804", + "description": "Eye Tech" + }, + { + "device_id": 325, + "well_id": 0, + "device_mac": "CA09FD8223DB", + "description": null + }, + { + "device_id": 326, + "well_id": 40, + "device_mac": "308398C71EA8", + "description": "" + }, + { + "device_id": 327, + "well_id": 47, + "device_mac": "308398DF2EF4", + "description": "ET-B4" + }, + { + "device_id": 328, + "well_id": 4, + "device_mac": "98CDACD074A0", + "description": "" + }, + { + "device_id": 329, + "well_id": 31, + "device_mac": "308398DF2F0C", + "description": "" + }, + { + "device_id": 330, + "well_id": 28, + "device_mac": "308398DF3174", + "description": "" + }, + { + "device_id": 331, + "well_id": 0, + "device_mac": "308398C72040", + "description": "" + }, + { + "device_id": 332, + "well_id": 46, + "device_mac": "308398DF328C", + "description": "" + }, + { + "device_id": 333, + "well_id": 0, + "device_mac": "5A815C521647", + "description": null + }, + { + "device_id": 334, + "well_id": 27, + "device_mac": "308398C717A0", + "description": "Broken" + }, + { + "device_id": 335, + "well_id": 21, + "device_mac": "308398DF2FF0", + "description": "" + }, + { + "device_id": 336, + "well_id": 19, + "device_mac": "308398C727D0", + "description": "" + }, + { + "device_id": 337, + "well_id": 33, + "device_mac": "308398C721E0", + "description": "" + }, + { + "device_id": 338, + "well_id": 44, + "device_mac": "308398E055C0", + "description": "ET-B4" + }, + { + "device_id": 339, + "well_id": 25, + "device_mac": "308398C7293C", + "description": "" + }, + { + "device_id": 340, + "well_id": 49, + "device_mac": "308398C71B60", + "description": "" + }, + { + "device_id": 341, + "well_id": 16, + "device_mac": "308398E055E8", + "description": "" + }, + { + "device_id": 342, + "well_id": 22, + "device_mac": "308398C72140", + "description": "" + }, + { + "device_id": 343, + "well_id": 0, + "device_mac": "3C26406B9566", + "description": null + }, + { + "device_id": 344, + "well_id": 32, + "device_mac": "308398E056BC", + "description": "" + }, + { + "device_id": 345, + "well_id": 0, + "device_mac": "940E5EC56E2F", + "description": null + }, + { + "device_id": 346, + "well_id": 0, + "device_mac": "977C2C3D360A", + "description": null + }, + { + "device_id": 347, + "well_id": 0, + "device_mac": "9BFF446905F7", + "description": null + }, + { + "device_id": 348, + "well_id": 0, + "device_mac": "308398C71828", + "description": null + }, + { + "device_id": 349, + "well_id": 0, + "device_mac": "02C063642E4A", + "description": null + }, + { + "device_id": 350, + "well_id": 0, + "device_mac": "8BCD25F11DB9", + "description": null + }, + { + "device_id": 351, + "well_id": 0, + "device_mac": "AD685A81D9BF", + "description": null + }, + { + "device_id": 352, + "well_id": 0, + "device_mac": "861C78F35F75", + "description": null + }, + { + "device_id": 353, + "well_id": 0, + "device_mac": "1AC8CBC1FE2A", + "description": null + }, + { + "device_id": 354, + "well_id": 0, + "device_mac": "48249F9A13B3", + "description": null + }, + { + "device_id": 355, + "well_id": 0, + "device_mac": "D16D9B26CDB6", + "description": null + }, + { + "device_id": 356, + "well_id": 0, + "device_mac": "3F96C206BBF8", + "description": null + }, + { + "device_id": 361, + "well_id": 105, + "device_mac": "308398C7259C", + "description": "" + }, + { + "device_id": 364, + "well_id": 108, + "device_mac": "64B708890F88", + "description": null + }, + { + "device_id": 365, + "well_id": 109, + "device_mac": "64B708896BE0", + "description": "" + }, + { + "device_id": 366, + "well_id": 110, + "device_mac": "64B70888FB58", + "description": null + }, + { + "device_id": 368, + "well_id": 112, + "device_mac": "64B7088905D0", + "description": "" + }, + { + "device_id": 369, + "well_id": 113, + "device_mac": "64B7088905E0", + "description": "" + }, + { + "device_id": 370, + "well_id": 114, + "device_mac": "64B7088907C4", + "description": "" + }, + { + "device_id": 371, + "well_id": 115, + "device_mac": "64B70888FB84", + "description": "Kitchen" + }, + { + "device_id": 372, + "well_id": 116, + "device_mac": "64B7088904F0", + "description": "tree" + }, + { + "device_id": 373, + "well_id": 117, + "device_mac": "64B7088904F8", + "description": "" + }, + { + "device_id": 374, + "well_id": 118, + "device_mac": "64B708890F6C", + "description": null + }, + { + "device_id": 375, + "well_id": 119, + "device_mac": "64B70888FB80", + "description": "" + }, + { + "device_id": 376, + "well_id": 120, + "device_mac": "D8A01D4C79F0", + "description": "" + }, + { + "device_id": 377, + "well_id": 121, + "device_mac": "64B7088904D0", + "description": null + }, + { + "device_id": 597, + "well_id": 299, + "device_mac": "576C64435555", + "description": "" + }, + { + "device_id": 378, + "well_id": 122, + "device_mac": "64B7088902A4", + "description": "Master Bathroom" + }, + { + "device_id": 379, + "well_id": 123, + "device_mac": "308398C72C1C", + "description": "Living room" + }, + { + "device_id": 380, + "well_id": 124, + "device_mac": "64B7088905D8", + "description": "Office" + }, + { + "device_id": 381, + "well_id": 125, + "device_mac": "64B7088905DC", + "description": "Kitchen" + }, + { + "device_id": 383, + "well_id": 127, + "device_mac": "64B7088902AC", + "description": "Bathroom guest" + }, + { + "device_id": 384, + "well_id": 128, + "device_mac": "64B708890F74", + "description": "" + }, + { + "device_id": 385, + "well_id": 129, + "device_mac": "64B7088904E8", + "description": "moj" + }, + { + "device_id": 387, + "well_id": 131, + "device_mac": "4C7525A8454C", + "description": null + }, + { + "device_id": 388, + "well_id": 132, + "device_mac": "64B7088905FC", + "description": null + }, + { + "device_id": 389, + "well_id": 133, + "device_mac": "308398C724E4", + "description": null + }, + { + "device_id": 390, + "well_id": 134, + "device_mac": "64B708890F68", + "description": null + }, + { + "device_id": 391, + "well_id": 135, + "device_mac": "64B7088904EC", + "description": null + }, + { + "device_id": 392, + "well_id": 136, + "device_mac": "64B7088904DC", + "description": "" + }, + { + "device_id": 393, + "well_id": 137, + "device_mac": "64B7088907AC", + "description": "" + }, + { + "device_id": 394, + "well_id": 138, + "device_mac": "64B7088904F4", + "description": "" + }, + { + "device_id": 395, + "well_id": 139, + "device_mac": "64B7088902A8", + "description": "" + }, + { + "device_id": 396, + "well_id": 140, + "device_mac": "64B7088907D8", + "description": null + }, + { + "device_id": 397, + "well_id": 141, + "device_mac": "64B70888FB50", + "description": "null" + }, + { + "device_id": 403, + "well_id": 147, + "device_mac": "64B70888FB48", + "description": "" + }, + { + "device_id": 367, + "well_id": 111, + "device_mac": "64B708890F78", + "description": "Bedroom" + }, + { + "device_id": 382, + "well_id": 126, + "device_mac": "64B708890618", + "description": "Bedroom" + }, + { + "device_id": 404, + "well_id": 148, + "device_mac": "64B70889029C", + "description": "" + }, + { + "device_id": 405, + "well_id": 149, + "device_mac": "64B7088907B4", + "description": "" + }, + { + "device_id": 406, + "well_id": 150, + "device_mac": "64B70889028C", + "description": "" + }, + { + "device_id": 407, + "well_id": 151, + "device_mac": "64B708890290", + "description": "" + }, + { + "device_id": 408, + "well_id": 152, + "device_mac": "64B708890F84", + "description": "Na stolu" + }, + { + "device_id": 409, + "well_id": 153, + "device_mac": "64B70888FB68", + "description": "" + }, + { + "device_id": 411, + "well_id": 155, + "device_mac": "64B7088905F4", + "description": "Y" + }, + { + "device_id": 412, + "well_id": 156, + "device_mac": "308398C71D24", + "description": null + }, + { + "device_id": 413, + "well_id": 157, + "device_mac": "64B708896BD4", + "description": null + }, + { + "device_id": 414, + "well_id": 158, + "device_mac": "64B70888FB60", + "description": "" + }, + { + "device_id": 415, + "well_id": 159, + "device_mac": "64B708890500", + "description": "Mila" + }, + { + "device_id": 416, + "well_id": 160, + "device_mac": "64B70888FB54", + "description": "" + }, + { + "device_id": 417, + "well_id": 161, + "device_mac": "308398C7202C", + "description": "" + }, + { + "device_id": 418, + "well_id": 162, + "device_mac": "64B708890F60", + "description": null + }, + { + "device_id": 419, + "well_id": 163, + "device_mac": "D8A01D4DA814", + "description": null + }, + { + "device_id": 420, + "well_id": 164, + "device_mac": "64B7088907C0", + "description": "" + }, + { + "device_id": 421, + "well_id": 165, + "device_mac": "308398DF2F3C", + "description": null + }, + { + "device_id": 422, + "well_id": 166, + "device_mac": "64B708896C1C", + "description": "" + }, + { + "device_id": 423, + "well_id": 167, + "device_mac": "D8A01D692CA0", + "description": null + }, + { + "device_id": 424, + "well_id": 168, + "device_mac": "64B708896BCC", + "description": null + }, + { + "device_id": 425, + "well_id": 169, + "device_mac": "64B708890980", + "description": null + }, + { + "device_id": 426, + "well_id": 170, + "device_mac": "64B70888FB7C", + "description": "" + }, + { + "device_id": 427, + "well_id": 171, + "device_mac": "64B7088907B8", + "description": "" + }, + { + "device_id": 709, + "well_id": 466, + "device_mac": "316331356333", + "description": "" + }, + { + "device_id": 428, + "well_id": 172, + "device_mac": "64B7088907CC", + "description": "" + }, + { + "device_id": 429, + "well_id": 173, + "device_mac": "64B7088902CC", + "description": "" + }, + { + "device_id": 430, + "well_id": 174, + "device_mac": "D8A01D4DA4B8", + "description": null + }, + { + "device_id": 431, + "well_id": 175, + "device_mac": "308398C72DD4", + "description": null + }, + { + "device_id": 432, + "well_id": 176, + "device_mac": "308398C71E60", + "description": "" + }, + { + "device_id": 433, + "well_id": 177, + "device_mac": "64B7088907BC", + "description": "" + }, + { + "device_id": 434, + "well_id": 178, + "device_mac": "64B7088904E0", + "description": null + }, + { + "device_id": 435, + "well_id": 179, + "device_mac": "64B7088904D8", + "description": null + }, + { + "device_id": 436, + "well_id": 180, + "device_mac": "64B7088905CC", + "description": "" + }, + { + "device_id": 437, + "well_id": 181, + "device_mac": "64B708890F64", + "description": null + }, + { + "device_id": 438, + "well_id": 182, + "device_mac": "D8A01D4C7BE4", + "description": "" + }, + { + "device_id": 439, + "well_id": 183, + "device_mac": "24A1604E21D4", + "description": null + }, + { + "device_id": 440, + "well_id": 184, + "device_mac": "64B7088907DC", + "description": "" + }, + { + "device_id": 441, + "well_id": 185, + "device_mac": "64B7088904E4", + "description": null + }, + { + "device_id": 442, + "well_id": 186, + "device_mac": "64B708890F5C", + "description": null + }, + { + "device_id": 443, + "well_id": 187, + "device_mac": "64B7088907C8", + "description": "" + }, + { + "device_id": 444, + "well_id": 188, + "device_mac": "98CDACF0BCFC", + "description": "Master" + }, + { + "device_id": 445, + "well_id": 189, + "device_mac": "64B7088907D4", + "description": null + }, + { + "device_id": 446, + "well_id": 190, + "device_mac": "64B7088905D4", + "description": null + }, + { + "device_id": 447, + "well_id": 191, + "device_mac": "64B708890F80", + "description": null + }, + { + "device_id": 448, + "well_id": 192, + "device_mac": "64B7088907D0", + "description": "" + }, + { + "device_id": 449, + "well_id": 193, + "device_mac": "64B7088902B0", + "description": "" + }, + { + "device_id": 450, + "well_id": 194, + "device_mac": "64B70888FB74", + "description": "" + }, + { + "device_id": 451, + "well_id": 195, + "device_mac": "64B70889097C", + "description": null + }, + { + "device_id": 452, + "well_id": 196, + "device_mac": "64B708896C18", + "description": null + }, + { + "device_id": 453, + "well_id": 197, + "device_mac": "308398C72EF8", + "description": "" + }, + { + "device_id": 454, + "well_id": 198, + "device_mac": "64B70888FB78", + "description": "Ernie" + }, + { + "device_id": 455, + "well_id": 199, + "device_mac": "64B7088902A0", + "description": "" + }, + { + "device_id": 456, + "well_id": 100, + "device_mac": "308398DF3100", + "description": "" + }, + { + "device_id": 457, + "well_id": 0, + "device_mac": "16FC0BA69F9F", + "description": null + }, + { + "device_id": 458, + "well_id": 0, + "device_mac": "6B458FCE0E3C", + "description": null + }, + { + "device_id": 459, + "well_id": 0, + "device_mac": "D0B328108FEC", + "description": null + }, + { + "device_id": 460, + "well_id": 0, + "device_mac": "A3C8F90A1EE9", + "description": null + }, + { + "device_id": 461, + "well_id": 0, + "device_mac": "CD0299DEC7CB", + "description": null + }, + { + "device_id": 462, + "well_id": 0, + "device_mac": "AB287276CCDF", + "description": null + }, + { + "device_id": 463, + "well_id": 0, + "device_mac": "EBAC5CCE3B32", + "description": null + }, + { + "device_id": 464, + "well_id": 0, + "device_mac": "722AF199E6CE", + "description": null + }, + { + "device_id": 465, + "well_id": 0, + "device_mac": "16915C4271DE", + "description": null + }, + { + "device_id": 466, + "well_id": 0, + "device_mac": "2A0FFCC4C580", + "description": null + }, + { + "device_id": 467, + "well_id": 0, + "device_mac": "46FAE07996FD", + "description": null + }, + { + "device_id": 468, + "well_id": 0, + "device_mac": "5F37455807FB", + "description": null + }, + { + "device_id": 469, + "well_id": 0, + "device_mac": "3F5ECD608CD3", + "description": null + }, + { + "device_id": 470, + "well_id": 0, + "device_mac": "329E0C0D0AC7", + "description": null + }, + { + "device_id": 471, + "well_id": 0, + "device_mac": "17CA7205A8BB", + "description": null + }, + { + "device_id": 472, + "well_id": 0, + "device_mac": "2978FC972A13", + "description": null + }, + { + "device_id": 473, + "well_id": 0, + "device_mac": "AD520B68CC3F", + "description": null + }, + { + "device_id": 474, + "well_id": 0, + "device_mac": "6C19CEBE50B4", + "description": null + }, + { + "device_id": 475, + "well_id": 0, + "device_mac": "A33DA79FB4ED", + "description": null + }, + { + "device_id": 476, + "well_id": 0, + "device_mac": "DBF9D5E3D847", + "description": null + }, + { + "device_id": 477, + "well_id": 0, + "device_mac": "1EB4099F8C26", + "description": null + }, + { + "device_id": 478, + "well_id": 0, + "device_mac": "DF26BB5708A8", + "description": null + }, + { + "device_id": 479, + "well_id": 0, + "device_mac": "3C265D816C75", + "description": null + }, + { + "device_id": 480, + "well_id": 0, + "device_mac": "34927A9415AB", + "description": null + }, + { + "device_id": 481, + "well_id": 0, + "device_mac": "3D05EE0811F9", + "description": null + }, + { + "device_id": 482, + "well_id": 0, + "device_mac": "F9C881AA65E0", + "description": null + }, + { + "device_id": 485, + "well_id": 0, + "device_mac": "8D9B99C581FD", + "description": null + }, + { + "device_id": 486, + "well_id": 0, + "device_mac": "BBDA40EA0A86", + "description": null + }, + { + "device_id": 487, + "well_id": 0, + "device_mac": "81BC783E4996", + "description": null + }, + { + "device_id": 488, + "well_id": 0, + "device_mac": "FFCCAE8F0215", + "description": null + }, + { + "device_id": 489, + "well_id": 0, + "device_mac": "3BD19859E2E0", + "description": null + }, + { + "device_id": 490, + "well_id": 0, + "device_mac": "CCF8FB26533B", + "description": null + }, + { + "device_id": 491, + "well_id": 0, + "device_mac": "0E1EBDE28BA8", + "description": null + }, + { + "device_id": 492, + "well_id": 0, + "device_mac": "AF036F22BCB7", + "description": null + }, + { + "device_id": 493, + "well_id": 0, + "device_mac": "205D6834E4E8", + "description": null + }, + { + "device_id": 494, + "well_id": 0, + "device_mac": "B69C2BB08639", + "description": null + }, + { + "device_id": 495, + "well_id": 1, + "device_mac": "64B708890524", + "description": null + }, + { + "device_id": 502, + "well_id": 207, + "device_mac": "64B7088904B0", + "description": null + }, + { + "device_id": 503, + "well_id": 208, + "device_mac": "64B7088976BC", + "description": "" + }, + { + "device_id": 504, + "well_id": 209, + "device_mac": "64B708890874", + "description": "" + }, + { + "device_id": 506, + "well_id": 211, + "device_mac": "64B7088901E8", + "description": null + }, + { + "device_id": 508, + "well_id": 213, + "device_mac": "64B708890800", + "description": null + }, + { + "device_id": 509, + "well_id": 214, + "device_mac": "64B70889761C", + "description": null + }, + { + "device_id": 511, + "well_id": 216, + "device_mac": "64B708896E90", + "description": "master" + }, + { + "device_id": 512, + "well_id": 217, + "device_mac": "64B70889739C", + "description": null + }, + { + "device_id": 514, + "well_id": 294, + "device_mac": "64B708890888", + "description": "" + }, + { + "device_id": 516, + "well_id": 0, + "device_mac": "8FAB8CBDAA5F", + "description": null + }, + { + "device_id": 518, + "well_id": 220, + "device_mac": "64B708890F04", + "description": null + }, + { + "device_id": 519, + "well_id": 231, + "device_mac": "64B70889046C", + "description": null + }, + { + "device_id": 520, + "well_id": 221, + "device_mac": "64B708890954", + "description": null + }, + { + "device_id": 522, + "well_id": 274, + "device_mac": "64B708890614", + "description": null + }, + { + "device_id": 523, + "well_id": 278, + "device_mac": "64B70889050C", + "description": null + }, + { + "device_id": 528, + "well_id": 271, + "device_mac": "64B708890E54", + "description": "" + }, + { + "device_id": 545, + "well_id": 253, + "device_mac": "64B7088976A4", + "description": "" + }, + { + "device_id": 727, + "well_id": 481, + "device_mac": "10061C159AF4", + "description": "" + }, + { + "device_id": 554, + "well_id": 261, + "device_mac": "64B708897050", + "description": null + }, + { + "device_id": 555, + "well_id": 262, + "device_mac": "64B7088909C4", + "description": null + }, + { + "device_id": 573, + "well_id": 293, + "device_mac": "64B7088976A0", + "description": null + }, + { + "device_id": 574, + "well_id": 292, + "device_mac": "64B708890414", + "description": null + }, + { + "device_id": 708, + "well_id": 465, + "device_mac": "901506CA3A98", + "description": "" + }, + { + "device_id": 578, + "well_id": 0, + "device_mac": "7D57DEE3BC9F", + "description": null + }, + { + "device_id": 579, + "well_id": 0, + "device_mac": "AB200896C218", + "description": null + }, + { + "device_id": 580, + "well_id": 0, + "device_mac": "DE1D5CD557A3", + "description": null + }, + { + "device_id": 581, + "well_id": 0, + "device_mac": "5451F084ECA9", + "description": null + }, + { + "device_id": 582, + "well_id": 0, + "device_mac": "0C09228FE30E", + "description": null + }, + { + "device_id": 583, + "well_id": 0, + "device_mac": "47558F645D1D", + "description": null + }, + { + "device_id": 584, + "well_id": 0, + "device_mac": "4DBBC694C838", + "description": null + }, + { + "device_id": 585, + "well_id": 0, + "device_mac": "6EFE7FBFCE51", + "description": null + }, + { + "device_id": 586, + "well_id": 0, + "device_mac": "9AC12C2FF57B", + "description": null + }, + { + "device_id": 587, + "well_id": 0, + "device_mac": "F823C19B3A33", + "description": null + }, + { + "device_id": 588, + "well_id": 0, + "device_mac": "F958F64B9493", + "description": null + }, + { + "device_id": 589, + "well_id": 0, + "device_mac": "FC9107B47036", + "description": null + }, + { + "device_id": 590, + "well_id": 0, + "device_mac": "3C662CA26D6F", + "description": null + }, + { + "device_id": 736, + "well_id": 490, + "device_mac": "142B2F81A268", + "description": "" + }, + { + "device_id": 591, + "well_id": 295, + "device_mac": "64B708890784", + "description": null + }, + { + "device_id": 410, + "well_id": 154, + "device_mac": "64B708890F70", + "description": "" + }, + { + "device_id": 595, + "well_id": 297, + "device_mac": "4251426B7477", + "description": "" + }, + { + "device_id": 596, + "well_id": 298, + "device_mac": "643268435A30", + "description": "" + }, + { + "device_id": 739, + "well_id": 493, + "device_mac": "142B2F81A450", + "description": "" + }, + { + "device_id": 778, + "well_id": 532, + "device_mac": "901506CA3E88", + "description": "initial" + } + ], + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] job_weather +# Request: +{ + "function": "job_weather", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "job_id": "9" +} + +# Response: +{ + "ok": 1, + "weather": { + "time": "2025-11-22 20:30", + "temp_c": 16.8, + "temp_f": 62.2, + "humidity": 44, + "condition": "Clear sky" + }, + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] get_job_sensor_bucketed_data +# Request: +{ + "function": "get_job_sensor_bucketed_data", + "user_name": "jpeters", + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImpwZXRlcnMiLCJleHAiOjE3NjM5NTk0NjV9.3aerTVK12fwVehD10QjV6pkLZz99DzPLBArotntUITs", + "job_id": "9", + "sensor": "temperature", + "date": "2025-11-22", + "to_date": "2025-11-22", + "bucket_size": "15m" +} + +# Response: +{ + "ok": 1, + "job_id": "9", + "sensor": "temperature", + "units": "°F", + "color": "red", + "bucket_size": "15m", + "date_from": "2025-11-22", + "date_to": "2025-11-22", + "time_zone": "America/Los_Angeles", + "chart_data": [], + "status": "200 OK" +} +PASS + +---------------------------------------------------------------- +[Test] Cleanup +-> Deleting Job ID: 9 from database... +Cleanup successful. Database restored. + +=== Test Suite Finished === \ No newline at end of file diff --git a/job_available_devices-test.sh b/job_available_devices-test.sh new file mode 100644 index 0000000..3542f5f --- /dev/null +++ b/job_available_devices-test.sh @@ -0,0 +1,296 @@ +#!/bin/bash + +# ============================================================================== +# WellDrySense API Test Suite (Bash Version) +# Functionality: Exercises Job APIs including Create, List, Edit, Details, Weather, +# Sensor Data, and performs Database Cleanup. +# ============================================================================== + +# --- Configuration --- +# Load .env file if it exists +if [ -f .env ]; then + export $(cat .env | xargs) +fi + +# Defaults (can be overridden by env vars) +PORT="${PORT:-8002}" +BASE_URL="http://localhost:$PORT/api/well_api" +API_USER="${API_USER:-jpeters}" +API_PASSWORD="${API_PASSWORD:-WellJson}" +DB_NAME="${DB_NAME:-wellnuo}" +DB_USER="${DB_USER:-postgres}" +DB_HOST="${DB_HOST:-localhost}" +DB_PORT="${DB_PORT:-5432}" +# DB_PASSWORD should be set in .env or exported + +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Global Variables +TOKEN="" +USER_ID="" +JOB_ID="" + +# Check for jq +if ! command -v jq &> /dev/null; then + echo -e "${RED}Error: 'jq' is not installed. Please install it to run this script.${NC}" + exit 1 +fi + +echo -e "${BLUE}=== Setting up WellDrySense Test Suite on Port $PORT ===${NC}" + +# ============================================================================== +# Helper Functions +# ============================================================================== + +# Function to print section headers +print_header() { + echo -e "\n${BLUE}----------------------------------------------------------------${NC}" + echo -e "${BLUE}[Test] $1${NC}" +} + +# Function to perform a POST request +# Usage: perform_test "Test Name" "JSON_PAYLOAD_STRING" +perform_test() { + local test_name="$1" + local json_payload="$2" + + print_header "$test_name" + + # 1. Print Request + echo "# Request:" + echo "$json_payload" | jq '.' + + # 2. Convert JSON to Form Data for curl (flattening simple objects) + # Note: This simple conversion handles top-level keys. + # Complex nested JSON strings (like 'devices') need to be passed as strings in the input JSON. + local form_data="" + + # Extract keys and values and build form string + while IFS="=" read -r key value; do + if [ -n "$key" ]; then + # URL encode the value + encoded_value=$(printf '%s' "$value" | jq -sRr @uri) + if [ -z "$form_data" ]; then + form_data="${key}=${encoded_value}" + else + form_data="${form_data}&${key}=${encoded_value}" + fi + fi + done < <(echo "$json_payload" | jq -r "to_entries|map(\"\(.key)=\(.value)\")|.[]") + + # 3. Execute Request + response=$(curl -s -X POST "$BASE_URL" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "$form_data") + + # 4. Print Response + echo -e "\n# Response:" + if [ -z "$response" ]; then + echo "(Empty Response)" + echo -e "${RED}FAIL${NC}" + return 1 + else + echo "$response" | jq '.' 2>/dev/null || echo "$response" + fi + + # 5. Evaluate Pass/Fail based on "ok": 1 + ok_val=$(echo "$response" | jq -r '.ok // .status // 0') + + # Handle different response structures (some return {status: 200}, some {ok: 1}) + if [ "$ok_val" == "1" ] || [ "$ok_val" == "200" ] || [ "$ok_val" == "success" ]; then + echo -e "${GREEN}PASS${NC}" + + # Extract Job ID if this was the create step + if [ "$test_name" == "job_create" ]; then + JOB_ID=$(echo "$response" | jq -r '.job_id') + echo "-> Captured Job ID: $JOB_ID" + fi + return 0 + else + error_msg=$(echo "$response" | jq -r '.error // .message // "Unknown error"') + echo -e "${RED}FAIL: $error_msg${NC}" + return 1 + fi +} + +# ============================================================================== +# Test Execution +# ============================================================================== + +# 1. Login / Credentials +# ---------------------- +login_payload=$(jq -n \ + --arg fn "credentials" \ + --arg un "$API_USER" \ + --arg ps "$API_PASSWORD" \ + --arg cid "bash-suite" \ + --arg nonce "test-nonce" \ + '{function: $fn, user_name: $un, ps: $ps, clientId: $cid, nonce: $nonce}') + +print_header "Login" +echo "# Request:" +echo "$login_payload" | jq '.' + +# Special handling for login to capture token +response=$(curl -s -X POST "$BASE_URL" -d "function=credentials&user_name=$API_USER&ps=$API_PASSWORD&clientId=bash-suite&nonce=test-nonce") + +echo -e "\n# Response:" +echo "$response" | jq '.' + +TOKEN=$(echo "$response" | jq -r '.access_token // .data.access_token') +USER_ID=$(echo "$response" | jq -r '.user_id // .data.user_id') + +if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then + echo -e "${GREEN}PASS${NC} (User ID: $USER_ID)" +else + echo -e "${RED}FATAL: Login failed. Check credentials.${NC}" + exit 1 +fi + +# # 2. Create Job +# # ---------------------- +# # Note: We pass JSON strings for complex fields like 'devices' and 'alerts_config' +# devices_json='[{"mac": "TEST_MAC_VIRTUAL", "location": "Lab"}]' +# alerts_json='{"temp_high": 30}' + +# create_payload=$(jq -n \ +# --arg fn "job_create" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg cn "TEST_SUITE_CUSTOMER_BASH" \ +# --arg as "123 Bash Script Ln" \ +# --arg ac "Shellville" \ +# --arg dev "$devices_json" \ +# --arg lat "34.05" \ +# --arg lng "-118.25" \ +# '{function: $fn, user_name: $un, token: $tk, customer_name: $cn, address_street: $as, address_city: $ac, devices: $dev, lat: $lat, lng: $lng}') + +# perform_test "job_create" "$create_payload" || exit 1 + +# # 3. Job List +# # ---------------------- +# list_payload=$(jq -n \ +# --arg fn "job_list" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# '{function: $fn, user_name: $un, token: $tk}') + +# perform_test "job_list" "$list_payload" + +# # 4. Job Details +# # ---------------------- +# details_payload=$(jq -n \ +# --arg fn "job_details" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +# perform_test "job_details" "$details_payload" + +# # 5. Job Edit (Stop Job) +# # ---------------------- +# edit_payload=$(jq -n \ +# --arg fn "job_edit" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# --arg st "Stopped" \ +# --arg dt "2025-12-31T23:59:59" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid, job_status: $st, date_to: $dt}') + +# perform_test "job_edit" "$edit_payload" + + +# ... previous parts of script ... + +# ... previous sections (Login, Create Job, etc.) ... + +# 6. Available Devices +# ---------------------- +# Note: The API now derives the deployment ID from the user_name -> person_details. +# well_id is not sent as a parameter. + +# This payload works correctly with the new implementation +avail_payload=$(jq -n \ + --arg fn "job_available_devices" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, user_name: $un, token: $tk}') + +perform_test "job_available_devices" "$avail_payload" + +# This payload works correctly with the new implementation +avail_payload=$(jq -n \ + --arg fn "job_available_devices2" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, user_name: $un, token: $tk}') + +perform_test "job_available_devices2" "$avail_payload" + +# ... remaining sections ... + +# ... rest of script ... + +# # 7. Job Weather +# # ---------------------- +# weather_payload=$(jq -n \ +# --arg fn "job_weather" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +# perform_test "job_weather" "$weather_payload" + +# # 8. Job Sensor Bucketed Data (New Test) +# # ---------------------- +# # Using dynamic dates for the test +# DATE_FROM=$(date +%Y-%m-%d) +# DATE_TO=$(date +%Y-%m-%d) + +# sensor_payload=$(jq -n \ +# --arg fn "get_job_sensor_bucketed_data" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# --arg sens "temperature" \ +# --arg dt "$DATE_FROM" \ +# --arg dtt "$DATE_TO" \ +# --arg bs "15m" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid, sensor: $sens, date: $dt, to_date: $dtt, bucket_size: $bs}') + +# perform_test "get_job_sensor_bucketed_data" "$sensor_payload" + +# ============================================================================== +# Cleanup +# ============================================================================== +print_header "Cleanup" + +if [ -n "$JOB_ID" ]; then + echo "-> Deleting Job ID: $JOB_ID from database..." + + # Use PGPASSWORD for non-interactive auth if set + export PGPASSWORD="${DB_PASSWORD}" + + psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c "DELETE FROM public.jobs WHERE job_id = $JOB_ID;" > /dev/null 2>&1 + + if [ $? -eq 0 ]; then + echo -e "${GREEN}Cleanup successful. Database restored.${NC}" + else + echo -e "${RED}Cleanup failed. Please manually delete job_id $JOB_ID from public.jobs.${NC}" + echo "Command attempted: psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \"DELETE FROM public.jobs WHERE job_id = $JOB_ID;\"" + fi +else + echo "No Job ID created, skipping cleanup." +fi + +echo -e "\n${BLUE}=== Test Suite Finished ===${NC}" +# ============================================================================== +# well-api.py modifications to support WellDrySense API on port 1998 +# ============================================================================== \ No newline at end of file diff --git a/postgress.sql b/postgress.sql new file mode 100644 index 0000000..3099edb --- /dev/null +++ b/postgress.sql @@ -0,0 +1,5808 @@ +pg_dump: warning: there are circular foreign-key constraints on this table: +pg_dump: detail: hypertable +pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints. +pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem. +pg_dump: warning: there are circular foreign-key constraints on this table: +pg_dump: detail: chunk +pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints. +pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem. +pg_dump: warning: there are circular foreign-key constraints on this table: +pg_dump: detail: continuous_agg +pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints. +pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem. +-- +-- PostgreSQL database dump +-- + +\restrict nEgDhKD6B4nWaKSvB1ltprY3sHDNBEhrNLwMHP5zWu9gM4hHDn5zuiRnbZjRlH7 + +-- Dumped from database version 16.10 (Ubuntu 16.10-0ubuntu0.24.04.1) +-- Dumped by pg_dump version 16.10 (Ubuntu 16.10-0ubuntu0.24.04.1) + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: timescaledb; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS timescaledb WITH SCHEMA public; + + +-- +-- Name: EXTENSION timescaledb; Type: COMMENT; Schema: -; Owner: +-- + +COMMENT ON EXTENSION timescaledb IS 'Enables scalable inserts and complex queries for time-series data (Apache 2 Edition)'; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: radar_readings; Type: TABLE; Schema: public; Owner: well_app +-- + +CREATE TABLE public.radar_readings ( + "time" timestamp with time zone NOT NULL, + device_id integer, + absent double precision, + moving double precision, + stationary double precision, + "both" double precision, + m0 double precision, + m1 double precision, + m2 double precision, + m3 double precision, + m4 double precision, + m5 double precision, + m6 double precision, + m7 double precision, + m8 double precision, + s0 double precision, + s1 double precision, + s2 double precision, + s3 double precision, + s4 double precision, + s5 double precision, + s6 double precision, + s7 double precision, + s8 double precision +); + + +ALTER TABLE public.radar_readings OWNER TO well_app; + +-- +-- Name: _hyper_3_101_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_101_chunk ( + CONSTRAINT constraint_101 CHECK ((("time" >= '2025-08-20 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-27 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_101_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_103_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_103_chunk ( + CONSTRAINT constraint_103 CHECK ((("time" >= '2025-08-27 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-03 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_103_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_105_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_105_chunk ( + CONSTRAINT constraint_105 CHECK ((("time" >= '2025-09-03 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-10 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_105_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_107_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_107_chunk ( + CONSTRAINT constraint_107 CHECK ((("time" >= '2025-09-10 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-17 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_107_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_109_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_109_chunk ( + CONSTRAINT constraint_109 CHECK ((("time" >= '2025-09-17 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-24 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_109_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_10_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_10_chunk ( + CONSTRAINT constraint_10 CHECK ((("time" >= '2024-09-25 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_10_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_111_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_111_chunk ( + CONSTRAINT constraint_111 CHECK ((("time" >= '2025-09-24 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-01 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_111_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_113_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_113_chunk ( + CONSTRAINT constraint_113 CHECK ((("time" >= '2025-10-01 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-08 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_113_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_114_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_114_chunk ( + CONSTRAINT constraint_114 CHECK ((("time" >= '2025-10-08 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-15 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_114_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_117_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_117_chunk ( + CONSTRAINT constraint_117 CHECK ((("time" >= '2025-10-15 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-22 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_117_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_119_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_119_chunk ( + CONSTRAINT constraint_119 CHECK ((("time" >= '2025-10-22 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-29 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_119_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_11_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_11_chunk ( + CONSTRAINT constraint_11 CHECK ((("time" >= '2024-10-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_11_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_121_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_121_chunk ( + CONSTRAINT constraint_121 CHECK ((("time" >= '2025-10-29 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-11-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_121_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_123_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_123_chunk ( + CONSTRAINT constraint_123 CHECK ((("time" >= '2025-11-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-12 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_123_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_125_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_125_chunk ( + CONSTRAINT constraint_125 CHECK ((("time" >= '2025-11-12 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-19 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_125_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_127_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_127_chunk ( + CONSTRAINT constraint_127 CHECK ((("time" >= '2025-11-19 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-26 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_127_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_12_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_12_chunk ( + CONSTRAINT constraint_12 CHECK ((("time" >= '2024-10-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_12_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_13_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_13_chunk ( + CONSTRAINT constraint_13 CHECK ((("time" >= '2024-10-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_13_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_14_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_14_chunk ( + CONSTRAINT constraint_14 CHECK ((("time" >= '2024-10-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_14_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_15_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_15_chunk ( + CONSTRAINT constraint_15 CHECK ((("time" >= '2024-10-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-11-06 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_15_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_16_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_16_chunk ( + CONSTRAINT constraint_16 CHECK ((("time" >= '2024-11-06 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-13 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_16_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_17_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_17_chunk ( + CONSTRAINT constraint_17 CHECK ((("time" >= '2025-01-08 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-15 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_17_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_18_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_18_chunk ( + CONSTRAINT constraint_18 CHECK ((("time" >= '2025-01-15 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-22 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_18_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_19_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_19_chunk ( + CONSTRAINT constraint_19 CHECK ((("time" >= '2025-01-22 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-29 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_19_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_1_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_1_chunk ( + CONSTRAINT constraint_1 CHECK ((("time" >= '2024-11-13 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-20 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_1_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_20_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_20_chunk ( + CONSTRAINT constraint_20 CHECK ((("time" >= '2025-01-29 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_20_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_21_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_21_chunk ( + CONSTRAINT constraint_21 CHECK ((("time" >= '2025-02-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-12 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_21_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_22_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_22_chunk ( + CONSTRAINT constraint_22 CHECK ((("time" >= '2025-02-12 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-19 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_22_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_2_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_2_chunk ( + CONSTRAINT constraint_2 CHECK ((("time" >= '2024-11-20 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-27 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_2_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_3_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_3_chunk ( + CONSTRAINT constraint_3 CHECK ((("time" >= '2024-11-27 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-04 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_3_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_45_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_45_chunk ( + CONSTRAINT constraint_45 CHECK ((("time" >= '2025-02-19 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-26 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_45_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_48_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_48_chunk ( + CONSTRAINT constraint_48 CHECK ((("time" >= '2025-02-26 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-03-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_48_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_49_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_49_chunk ( + CONSTRAINT constraint_49 CHECK ((("time" >= '2025-03-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-03-12 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_49_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_4_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_4_chunk ( + CONSTRAINT constraint_4 CHECK ((("time" >= '2024-12-04 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-11 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_4_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_52_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_52_chunk ( + CONSTRAINT constraint_52 CHECK ((("time" >= '2025-03-12 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-03-19 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_52_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_53_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_53_chunk ( + CONSTRAINT constraint_53 CHECK ((("time" >= '2025-03-19 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-03-26 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_53_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_55_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_55_chunk ( + CONSTRAINT constraint_55 CHECK ((("time" >= '2025-03-26 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_55_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_57_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_57_chunk ( + CONSTRAINT constraint_57 CHECK ((("time" >= '2025-04-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_57_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_59_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_59_chunk ( + CONSTRAINT constraint_59 CHECK ((("time" >= '2025-04-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_59_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_5_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_5_chunk ( + CONSTRAINT constraint_5 CHECK ((("time" >= '2024-12-11 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-18 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_5_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_61_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_61_chunk ( + CONSTRAINT constraint_61 CHECK ((("time" >= '2025-04-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_61_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_63_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_63_chunk ( + CONSTRAINT constraint_63 CHECK ((("time" >= '2025-04-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_63_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_65_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_65_chunk ( + CONSTRAINT constraint_65 CHECK ((("time" >= '2025-04-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-07 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_65_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_68_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_68_chunk ( + CONSTRAINT constraint_68 CHECK ((("time" >= '2025-05-07 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-14 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_68_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_6_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_6_chunk ( + CONSTRAINT constraint_6 CHECK ((("time" >= '2024-12-18 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-25 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_6_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_70_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_70_chunk ( + CONSTRAINT constraint_70 CHECK ((("time" >= '2025-05-14 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-21 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_70_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_72_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_72_chunk ( + CONSTRAINT constraint_72 CHECK ((("time" >= '2025-05-21 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-28 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_72_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_74_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_74_chunk ( + CONSTRAINT constraint_74 CHECK ((("time" >= '2025-05-28 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-04 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_74_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_75_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_75_chunk ( + CONSTRAINT constraint_75 CHECK ((("time" >= '2025-06-04 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-11 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_75_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_77_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_77_chunk ( + CONSTRAINT constraint_77 CHECK ((("time" >= '2025-06-11 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-18 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_77_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_79_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_79_chunk ( + CONSTRAINT constraint_79 CHECK ((("time" >= '2025-06-18 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-25 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_79_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_7_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_7_chunk ( + CONSTRAINT constraint_7 CHECK ((("time" >= '2024-12-25 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-01 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_7_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_82_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_82_chunk ( + CONSTRAINT constraint_82 CHECK ((("time" >= '2025-06-25 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_82_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_84_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_84_chunk ( + CONSTRAINT constraint_84 CHECK ((("time" >= '2025-07-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_84_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_85_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_85_chunk ( + CONSTRAINT constraint_85 CHECK ((("time" >= '2025-07-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_85_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_88_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_88_chunk ( + CONSTRAINT constraint_88 CHECK ((("time" >= '2025-07-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_88_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_8_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_8_chunk ( + CONSTRAINT constraint_8 CHECK ((("time" >= '2025-01-01 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-08 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_8_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_90_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_90_chunk ( + CONSTRAINT constraint_90 CHECK ((("time" >= '2025-07-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_90_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_95_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_95_chunk ( + CONSTRAINT constraint_95 CHECK ((("time" >= '2025-07-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-06 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_95_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_97_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_97_chunk ( + CONSTRAINT constraint_97 CHECK ((("time" >= '2025-08-06 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-13 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_97_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_99_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_99_chunk ( + CONSTRAINT constraint_99 CHECK ((("time" >= '2025-08-13 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-20 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_99_chunk OWNER TO well_app; + +-- +-- Name: _hyper_3_9_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_3_9_chunk ( + CONSTRAINT constraint_9 CHECK ((("time" >= '1969-12-31 16:00:00-08'::timestamp with time zone) AND ("time" < '1970-01-07 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.radar_readings); + + +ALTER TABLE _timescaledb_internal._hyper_3_9_chunk OWNER TO well_app; + +-- +-- Name: sensor_readings; Type: TABLE; Schema: public; Owner: well_app +-- + +CREATE TABLE public.sensor_readings ( + "time" timestamp with time zone NOT NULL, + device_id integer NOT NULL, + temperature double precision, + humidity double precision, + pressure double precision, + light double precision, + s0 double precision, + s1 double precision, + s2 double precision, + s3 double precision, + s4 double precision, + s5 double precision, + s6 double precision, + s7 double precision, + s8 double precision, + s9 double precision, + mtype smallint DEFAULT 0 +); + + +ALTER TABLE public.sensor_readings OWNER TO well_app; + +-- +-- Name: _hyper_4_100_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_100_chunk ( + CONSTRAINT constraint_100 CHECK ((("time" >= '2025-08-20 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-27 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_100_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_102_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_102_chunk ( + CONSTRAINT constraint_102 CHECK ((("time" >= '2025-08-27 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-03 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_102_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_104_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_104_chunk ( + CONSTRAINT constraint_104 CHECK ((("time" >= '2025-09-03 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-10 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_104_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_106_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_106_chunk ( + CONSTRAINT constraint_106 CHECK ((("time" >= '2025-09-10 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-17 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_106_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_108_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_108_chunk ( + CONSTRAINT constraint_108 CHECK ((("time" >= '2025-09-17 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-09-24 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_108_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_110_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_110_chunk ( + CONSTRAINT constraint_110 CHECK ((("time" >= '2025-09-24 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-01 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_110_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_112_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_112_chunk ( + CONSTRAINT constraint_112 CHECK ((("time" >= '2025-10-01 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-08 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_112_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_115_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_115_chunk ( + CONSTRAINT constraint_115 CHECK ((("time" >= '2025-10-08 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-15 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_115_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_116_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_116_chunk ( + CONSTRAINT constraint_116 CHECK ((("time" >= '2025-10-15 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-22 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_116_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_118_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_118_chunk ( + CONSTRAINT constraint_118 CHECK ((("time" >= '2025-10-22 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-10-29 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_118_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_120_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_120_chunk ( + CONSTRAINT constraint_120 CHECK ((("time" >= '2025-10-29 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-11-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_120_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_122_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_122_chunk ( + CONSTRAINT constraint_122 CHECK ((("time" >= '2025-11-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-12 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_122_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_124_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_124_chunk ( + CONSTRAINT constraint_124 CHECK ((("time" >= '2025-11-12 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-19 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_124_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_126_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_126_chunk ( + CONSTRAINT constraint_126 CHECK ((("time" >= '2025-11-19 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-11-26 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_126_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_23_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_23_chunk ( + CONSTRAINT constraint_23 CHECK ((("time" >= '1969-12-31 16:00:00-08'::timestamp with time zone) AND ("time" < '1970-01-07 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_23_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_24_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_24_chunk ( + CONSTRAINT constraint_24 CHECK ((("time" >= '2024-09-25 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_24_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_25_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_25_chunk ( + CONSTRAINT constraint_25 CHECK ((("time" >= '2024-10-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_25_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_26_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_26_chunk ( + CONSTRAINT constraint_26 CHECK ((("time" >= '2024-10-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_26_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_27_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_27_chunk ( + CONSTRAINT constraint_27 CHECK ((("time" >= '2024-10-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_27_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_28_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_28_chunk ( + CONSTRAINT constraint_28 CHECK ((("time" >= '2024-10-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-10-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_28_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_29_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_29_chunk ( + CONSTRAINT constraint_29 CHECK ((("time" >= '2024-10-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2024-11-06 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_29_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_30_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_30_chunk ( + CONSTRAINT constraint_30 CHECK ((("time" >= '2024-11-06 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-13 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_30_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_31_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_31_chunk ( + CONSTRAINT constraint_31 CHECK ((("time" >= '2024-11-13 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-20 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_31_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_32_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_32_chunk ( + CONSTRAINT constraint_32 CHECK ((("time" >= '2024-11-20 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-11-27 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_32_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_33_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_33_chunk ( + CONSTRAINT constraint_33 CHECK ((("time" >= '2024-11-27 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-04 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_33_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_34_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_34_chunk ( + CONSTRAINT constraint_34 CHECK ((("time" >= '2024-12-04 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-11 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_34_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_35_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_35_chunk ( + CONSTRAINT constraint_35 CHECK ((("time" >= '2024-12-11 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-18 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_35_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_36_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_36_chunk ( + CONSTRAINT constraint_36 CHECK ((("time" >= '2024-12-18 16:00:00-08'::timestamp with time zone) AND ("time" < '2024-12-25 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_36_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_37_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_37_chunk ( + CONSTRAINT constraint_37 CHECK ((("time" >= '2024-12-25 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-01 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_37_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_38_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_38_chunk ( + CONSTRAINT constraint_38 CHECK ((("time" >= '2025-01-01 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-08 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_38_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_39_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_39_chunk ( + CONSTRAINT constraint_39 CHECK ((("time" >= '2025-01-08 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-15 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_39_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_40_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_40_chunk ( + CONSTRAINT constraint_40 CHECK ((("time" >= '2025-01-15 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-22 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_40_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_41_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_41_chunk ( + CONSTRAINT constraint_41 CHECK ((("time" >= '2025-01-22 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-01-29 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_41_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_42_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_42_chunk ( + CONSTRAINT constraint_42 CHECK ((("time" >= '2025-01-29 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_42_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_43_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_43_chunk ( + CONSTRAINT constraint_43 CHECK ((("time" >= '2025-02-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-12 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_43_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_44_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_44_chunk ( + CONSTRAINT constraint_44 CHECK ((("time" >= '2025-02-12 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-19 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_44_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_46_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_46_chunk ( + CONSTRAINT constraint_46 CHECK ((("time" >= '2025-02-19 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-02-26 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_46_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_47_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_47_chunk ( + CONSTRAINT constraint_47 CHECK ((("time" >= '2025-02-26 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-03-05 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_47_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_50_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_50_chunk ( + CONSTRAINT constraint_50 CHECK ((("time" >= '2025-03-05 16:00:00-08'::timestamp with time zone) AND ("time" < '2025-03-12 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_50_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_51_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_51_chunk ( + CONSTRAINT constraint_51 CHECK ((("time" >= '2025-03-12 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-03-19 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_51_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_54_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_54_chunk ( + CONSTRAINT constraint_54 CHECK ((("time" >= '2025-03-19 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-03-26 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_54_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_56_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_56_chunk ( + CONSTRAINT constraint_56 CHECK ((("time" >= '2025-03-26 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_56_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_58_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_58_chunk ( + CONSTRAINT constraint_58 CHECK ((("time" >= '2025-04-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_58_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_60_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_60_chunk ( + CONSTRAINT constraint_60 CHECK ((("time" >= '2025-04-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_60_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_62_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_62_chunk ( + CONSTRAINT constraint_62 CHECK ((("time" >= '2025-04-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_62_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_64_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_64_chunk ( + CONSTRAINT constraint_64 CHECK ((("time" >= '2025-04-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-04-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_64_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_66_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_66_chunk ( + CONSTRAINT constraint_66 CHECK ((("time" >= '2025-04-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-07 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_66_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_67_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_67_chunk ( + CONSTRAINT constraint_67 CHECK ((("time" >= '2025-05-07 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-14 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_67_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_69_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_69_chunk ( + CONSTRAINT constraint_69 CHECK ((("time" >= '2025-05-14 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-21 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_69_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_71_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_71_chunk ( + CONSTRAINT constraint_71 CHECK ((("time" >= '2025-05-21 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-05-28 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_71_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_73_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_73_chunk ( + CONSTRAINT constraint_73 CHECK ((("time" >= '2025-05-28 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-04 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_73_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_76_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_76_chunk ( + CONSTRAINT constraint_76 CHECK ((("time" >= '2025-06-04 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-11 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_76_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_78_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_78_chunk ( + CONSTRAINT constraint_78 CHECK ((("time" >= '2025-06-11 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-18 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_78_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_80_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_80_chunk ( + CONSTRAINT constraint_80 CHECK ((("time" >= '2025-06-18 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-06-25 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_80_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_81_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_81_chunk ( + CONSTRAINT constraint_81 CHECK ((("time" >= '2025-06-25 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-02 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_81_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_83_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_83_chunk ( + CONSTRAINT constraint_83 CHECK ((("time" >= '2025-07-02 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_83_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_86_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_86_chunk ( + CONSTRAINT constraint_86 CHECK ((("time" >= '2025-07-09 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-16 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_86_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_87_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_87_chunk ( + CONSTRAINT constraint_87 CHECK ((("time" >= '2025-07-16 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-23 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_87_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_89_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_89_chunk ( + CONSTRAINT constraint_89 CHECK ((("time" >= '2025-07-23 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-07-30 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_89_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_91_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_91_chunk ( + CONSTRAINT constraint_91 CHECK ((("time" >= '1970-01-07 16:00:00-08'::timestamp with time zone) AND ("time" < '1970-01-14 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_91_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_92_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_92_chunk ( + CONSTRAINT constraint_92 CHECK ((("time" >= '1970-09-02 17:00:00-07'::timestamp with time zone) AND ("time" < '1970-09-09 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_92_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_93_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_93_chunk ( + CONSTRAINT constraint_93 CHECK ((("time" >= '2023-03-01 16:00:00-08'::timestamp with time zone) AND ("time" < '2023-03-08 16:00:00-08'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_93_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_94_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_94_chunk ( + CONSTRAINT constraint_94 CHECK ((("time" >= '2025-07-30 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-06 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_94_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_96_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_96_chunk ( + CONSTRAINT constraint_96 CHECK ((("time" >= '2025-08-06 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-13 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_96_chunk OWNER TO well_app; + +-- +-- Name: _hyper_4_98_chunk; Type: TABLE; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE TABLE _timescaledb_internal._hyper_4_98_chunk ( + CONSTRAINT constraint_98 CHECK ((("time" >= '2025-08-13 17:00:00-07'::timestamp with time zone) AND ("time" < '2025-08-20 17:00:00-07'::timestamp with time zone))) +) +INHERITS (public.sensor_readings); + + +ALTER TABLE _timescaledb_internal._hyper_4_98_chunk OWNER TO well_app; + +-- +-- Name: alarms_voice; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.alarms_voice ( + index integer NOT NULL, + "time" timestamp with time zone, + call_session_id text, + initiated text, + answered text, + playback_started text, + playback_ended text, + hangup text +); + + +ALTER TABLE public.alarms_voice OWNER TO postgres; + +-- +-- Name: arti_reports; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.arti_reports ( + index integer NOT NULL, + content_raw text +); + + +ALTER TABLE public.arti_reports OWNER TO postgres; + +-- +-- Name: arti_reports_index_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public.arti_reports ALTER COLUMN index ADD GENERATED ALWAYS AS IDENTITY ( + SEQUENCE NAME public.arti_reports_index_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: azureq_2_rabbit_instances; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.azureq_2_rabbit_instances ( + instance_id text NOT NULL, + last_heartbeat timestamp with time zone, + status text, + container_id text +); + + +ALTER TABLE public.azureq_2_rabbit_instances OWNER TO postgres; + +-- +-- Name: deployment_details; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.deployment_details ( + deployment_id integer NOT NULL, + beneficiary_id integer, + caretaker_id integer, + owner_id integer, + installer_id integer, + devices text, + address_street text, + address_city text, + address_zip text, + address_state text, + address_country text, + wifis text, + lat real, + lng real, + gps_age integer, + note text, + floor_plan text, + overlapps text +); + + +ALTER TABLE public.deployment_details OWNER TO postgres; + +-- +-- Name: TABLE deployment_details; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public.deployment_details IS 'secret!'; + + +-- +-- Name: deployment_history_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.deployment_history_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.deployment_history_id_seq OWNER TO postgres; + +-- +-- Name: deployment_history; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.deployment_history ( + id integer DEFAULT nextval('public.deployment_history_id_seq'::regclass) NOT NULL, + deployment_id integer, + "time" real, + proximity text +); + + +ALTER TABLE public.deployment_history OWNER TO postgres; + +-- +-- Name: deployments; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.deployments ( + deployment_id integer NOT NULL, + time_edit real, + user_edit integer, + time_zone_s text, + persons integer, + gender integer, + race integer, + born integer, + pets integer, + context text, + alarm_details text +); + + +ALTER TABLE public.deployments OWNER TO postgres; + +-- +-- Name: deployments_deployment_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public.deployments ALTER COLUMN deployment_id ADD GENERATED ALWAYS AS IDENTITY ( + SEQUENCE NAME public.deployments_deployment_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: device_first_seen; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.device_first_seen ( + device_id integer NOT NULL, + first_seen_at timestamp with time zone NOT NULL +); + + +ALTER TABLE public.device_first_seen OWNER TO postgres; + +-- +-- Name: devices; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.devices ( + device_id integer NOT NULL, + device_mac text NOT NULL, + well_id integer, + description text, + location integer, + close_to text, + radar_threshold text, + fw_version text, + hw_version text, + ble_scan_period integer, + ble_scan_duration integer, + temperature_calib text, + humidity_calib text, + reporting_period_s integer, + reboot_time real, + led_schema text, + alert_details text, + other text, + group_id integer +); + + +ALTER TABLE public.devices OWNER TO postgres; + +-- +-- Name: COLUMN devices.description; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.devices.description IS 'User-defined name for the specific location of the device on a job site (e.g., Kitchen Under Sink).'; + + +-- +-- Name: devices_device_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.devices_device_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.devices_device_id_seq OWNER TO postgres; + +-- +-- Name: devices_device_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.devices_device_id_seq OWNED BY public.devices.device_id; + + +-- +-- Name: devices_last_reads; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.devices_last_reads ( + device_id integer NOT NULL, + temperature text, + humidity text, + light text, + pressure_blip text, + radar text, + smell text, + last_ssids text, + last_btles text +); + + +ALTER TABLE public.devices_last_reads OWNER TO postgres; + +-- +-- Name: disclaimers; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.disclaimers ( + id integer NOT NULL, + first_name text, + last_name text, + user_name text, + email text, + devices text, + date timestamp with time zone, + policy_version text +); + + +ALTER TABLE public.disclaimers OWNER TO postgres; + +-- +-- Name: disclaimers_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public.disclaimers ALTER COLUMN id ADD GENERATED ALWAYS AS IDENTITY ( + SEQUENCE NAME public.disclaimers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: format_contexts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.format_contexts ( + index integer NOT NULL, + voice_query text, + context text +); + + +ALTER TABLE public.format_contexts OWNER TO postgres; + +-- +-- Name: format_contexts_index_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.format_contexts_index_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.format_contexts_index_seq OWNER TO postgres; + +-- +-- Name: format_contexts_index_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.format_contexts_index_seq OWNED BY public.format_contexts.index; + + +-- +-- Name: jobs; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.jobs ( + job_id integer NOT NULL, + customer_name text, + mitigation_person_id integer, + key_person_name text, + key_person_mobile text, + key_person_email text, + address_street text, + address_city text, + address_zip text, + address_state text, + address_country text, + lat real, + lng real, + date_from timestamp with time zone DEFAULT CURRENT_TIMESTAMP, + date_to timestamp with time zone, + job_status text DEFAULT 'Active'::text NOT NULL, + devices text, + alerts_config jsonb, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP, + user_edit integer +); + + +ALTER TABLE public.jobs OWNER TO postgres; + +-- +-- Name: TABLE jobs; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public.jobs IS 'Stores job information for the WellDrySense water damage mitigation product.'; + + +-- +-- Name: COLUMN jobs.customer_name; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.customer_name IS 'The name of the client for whom the job is being done.'; + + +-- +-- Name: COLUMN jobs.mitigation_person_id; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.mitigation_person_id IS 'The user (from person_details) responsible for the job.'; + + +-- +-- Name: COLUMN jobs.key_person_name; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.key_person_name IS 'The name of the primary contact person at the client site.'; + + +-- +-- Name: COLUMN jobs.date_to; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.date_to IS 'The date the job was stopped or archived.'; + + +-- +-- Name: COLUMN jobs.job_status; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.job_status IS 'Lifecycle status of the job: Active, Stopped, Archived.'; + + +-- +-- Name: COLUMN jobs.devices; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.devices IS 'A JSON array of device MAC addresses assigned to this job.'; + + +-- +-- Name: COLUMN jobs.alerts_config; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON COLUMN public.jobs.alerts_config IS 'JSON object storing alert thresholds, e.g., {"temp_abs_high": 30, "hum_rel_above": 15}.'; + + +-- +-- Name: jobs_job_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.jobs_job_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.jobs_job_id_seq OWNER TO postgres; + +-- +-- Name: jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.jobs_job_id_seq OWNED BY public.jobs.job_id; + + +-- +-- Name: mobile_clients; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.mobile_clients ( + mqtt_id text NOT NULL, + user_name text, + user_id integer, + last_message_time bigint, + last_message text +); + + +ALTER TABLE public.mobile_clients OWNER TO postgres; + +-- +-- Name: mobile_clients_messages; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.mobile_clients_messages ( + id integer NOT NULL, + "time" bigint, + mqtt_id text, + message text, + function text +); + + +ALTER TABLE public.mobile_clients_messages OWNER TO postgres; + +-- +-- Name: mobile_clients_messages_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.mobile_clients_messages_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.mobile_clients_messages_id_seq OWNER TO postgres; + +-- +-- Name: mobile_clients_messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.mobile_clients_messages_id_seq OWNED BY public.mobile_clients_messages.id; + + +-- +-- Name: node_reds; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.node_reds ( + user_name text NOT NULL, + port integer, + status integer, + pid integer, + flow text, + last_activity integer, + time_on integer +); + + +ALTER TABLE public.node_reds OWNER TO postgres; + +-- +-- Name: node_reds_usage; Type: TABLE; Schema: public; Owner: well_app +-- + +CREATE TABLE public.node_reds_usage ( + index integer NOT NULL, + user_name text, + port integer, + pid integer, + time_on integer, + time_off integer +); + + +ALTER TABLE public.node_reds_usage OWNER TO well_app; + +-- +-- Name: node_reds_usage_index_seq; Type: SEQUENCE; Schema: public; Owner: well_app +-- + +CREATE SEQUENCE public.node_reds_usage_index_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.node_reds_usage_index_seq OWNER TO well_app; + +-- +-- Name: node_reds_usage_index_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: well_app +-- + +ALTER SEQUENCE public.node_reds_usage_index_seq OWNED BY public.node_reds_usage.index; + + +-- +-- Name: person_details; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.person_details ( + user_id integer NOT NULL, + role_ids text, + access_to_deployments text, + email text, + user_name text, + first_name text, + last_name text, + address_street text, + address_city text, + address_zip text, + address_state text, + address_country text, + time_edit real, + user_edit integer, + phone_number text, + picture text, + key text +); + + +ALTER TABLE public.person_details OWNER TO postgres; + +-- +-- Name: TABLE person_details; Type: COMMENT; Schema: public; Owner: postgres +-- + +COMMENT ON TABLE public.person_details IS 'secret!'; + + +-- +-- Name: person_details_person_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +ALTER TABLE public.person_details ALTER COLUMN user_id ADD GENERATED ALWAYS AS IDENTITY ( + SEQUENCE NAME public.person_details_person_id_seq + START WITH 34 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- Name: queue_muncher_instances; Type: TABLE; Schema: public; Owner: well_app +-- + +CREATE TABLE public.queue_muncher_instances ( + instance_id character varying NOT NULL, + last_heartbeat timestamp without time zone, + status character varying, + container_id character varying +); + + +ALTER TABLE public.queue_muncher_instances OWNER TO well_app; + +-- +-- Name: race; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.race ( + race_id integer NOT NULL, + race_name text, + race_description text +); + + +ALTER TABLE public.race OWNER TO postgres; + +-- +-- Name: roles; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.roles ( + role_id integer NOT NULL, + role_name text, + role_description text +); + + +ALTER TABLE public.roles OWNER TO postgres; + +-- +-- Name: telnyx_events; Type: TABLE; Schema: public; Owner: well_app +-- + +CREATE TABLE public.telnyx_events ( + id integer NOT NULL, + "time" integer, + report text +); + + +ALTER TABLE public.telnyx_events OWNER TO well_app; + +-- +-- Name: temp_radar_readings; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.temp_radar_readings ( + "time" timestamp with time zone, + device_id integer, + absent double precision, + moving double precision, + stationary double precision, + "both" double precision, + m0 double precision, + m1 double precision, + m2 double precision, + m3 double precision, + m4 double precision, + m5 double precision, + m6 double precision, + m7 double precision, + m8 double precision, + s0 double precision, + s1 double precision, + s2 double precision, + s3 double precision, + s4 double precision, + s5 double precision, + s6 double precision, + s7 double precision, + s8 double precision +); + + +ALTER TABLE public.temp_radar_readings OWNER TO postgres; + +-- +-- Name: temp_sensor_readings; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.temp_sensor_readings ( + "time" timestamp with time zone, + device_id integer, + temperature double precision, + humidity double precision, + pressure double precision, + light double precision, + s0 double precision, + s1 double precision, + s2 double precision, + s3 double precision, + s4 double precision, + s5 double precision, + s6 double precision, + s7 double precision, + s8 double precision, + s9 double precision +); + + +ALTER TABLE public.temp_sensor_readings OWNER TO postgres; + +-- +-- Name: user_tokens; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.user_tokens ( + id integer NOT NULL, + username character varying(255) NOT NULL, + token_id character varying(36) NOT NULL, + expires_at timestamp without time zone NOT NULL, + created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP, + revoked boolean DEFAULT false +); + + +ALTER TABLE public.user_tokens OWNER TO postgres; + +-- +-- Name: user_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.user_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.user_tokens_id_seq OWNER TO postgres; + +-- +-- Name: user_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.user_tokens_id_seq OWNED BY public.user_tokens.id; + + +-- +-- Name: user_topics; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.user_topics ( + id integer NOT NULL, + user_name character varying(255) NOT NULL, + topic character varying(255) NOT NULL, + permission character varying(2) NOT NULL, + created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP, + updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP +); + + +ALTER TABLE public.user_topics OWNER TO postgres; + +-- +-- Name: user_topics_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.user_topics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.user_topics_id_seq OWNER TO postgres; + +-- +-- Name: user_topics_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.user_topics_id_seq OWNED BY public.user_topics.id; + + +-- +-- Name: voice_contexts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.voice_contexts ( + index integer NOT NULL, + voice_query text, + context text +); + + +ALTER TABLE public.voice_contexts OWNER TO postgres; + +-- +-- Name: voice_contexts_index_seq; Type: SEQUENCE; Schema: public; Owner: postgres +-- + +CREATE SEQUENCE public.voice_contexts_index_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +ALTER SEQUENCE public.voice_contexts_index_seq OWNER TO postgres; + +-- +-- Name: voice_contexts_index_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres +-- + +ALTER SEQUENCE public.voice_contexts_index_seq OWNED BY public.voice_contexts.index; + + +-- +-- Name: _hyper_4_100_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_100_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_102_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_102_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_104_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_104_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_106_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_106_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_108_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_108_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_110_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_110_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_112_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_112_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_115_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_115_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_116_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_116_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_118_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_118_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_120_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_120_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_122_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_122_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_124_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_124_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_126_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_126_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_23_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_23_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_24_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_24_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_25_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_25_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_26_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_26_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_27_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_27_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_28_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_28_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_29_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_29_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_30_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_30_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_31_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_31_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_32_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_32_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_33_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_33_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_34_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_34_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_35_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_35_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_36_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_36_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_37_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_37_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_38_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_38_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_39_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_39_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_40_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_40_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_41_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_41_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_42_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_42_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_43_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_43_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_44_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_44_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_46_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_46_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_47_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_47_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_50_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_50_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_51_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_51_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_54_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_54_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_56_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_56_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_58_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_58_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_60_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_60_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_62_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_62_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_64_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_64_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_66_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_66_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_67_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_67_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_69_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_69_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_71_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_71_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_73_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_73_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_76_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_76_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_78_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_78_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_80_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_80_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_81_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_81_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_83_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_83_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_86_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_86_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_87_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_87_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_89_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_89_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_91_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_91_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_92_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_92_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_93_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_93_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_94_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_94_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_96_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_96_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: _hyper_4_98_chunk mtype; Type: DEFAULT; Schema: _timescaledb_internal; Owner: well_app +-- + +ALTER TABLE ONLY _timescaledb_internal._hyper_4_98_chunk ALTER COLUMN mtype SET DEFAULT 0; + + +-- +-- Name: devices device_id; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.devices ALTER COLUMN device_id SET DEFAULT nextval('public.devices_device_id_seq'::regclass); + + +-- +-- Name: format_contexts index; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.format_contexts ALTER COLUMN index SET DEFAULT nextval('public.format_contexts_index_seq'::regclass); + + +-- +-- Name: jobs job_id; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.jobs ALTER COLUMN job_id SET DEFAULT nextval('public.jobs_job_id_seq'::regclass); + + +-- +-- Name: mobile_clients_messages id; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.mobile_clients_messages ALTER COLUMN id SET DEFAULT nextval('public.mobile_clients_messages_id_seq'::regclass); + + +-- +-- Name: node_reds_usage index; Type: DEFAULT; Schema: public; Owner: well_app +-- + +ALTER TABLE ONLY public.node_reds_usage ALTER COLUMN index SET DEFAULT nextval('public.node_reds_usage_index_seq'::regclass); + + +-- +-- Name: user_tokens id; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_tokens ALTER COLUMN id SET DEFAULT nextval('public.user_tokens_id_seq'::regclass); + + +-- +-- Name: user_topics id; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_topics ALTER COLUMN id SET DEFAULT nextval('public.user_topics_id_seq'::regclass); + + +-- +-- Name: voice_contexts index; Type: DEFAULT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.voice_contexts ALTER COLUMN index SET DEFAULT nextval('public.voice_contexts_index_seq'::regclass); + + +-- +-- Name: alarms_voice alarms_voice_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.alarms_voice + ADD CONSTRAINT alarms_voice_pkey PRIMARY KEY (index); + + +-- +-- Name: arti_reports arti_reports_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.arti_reports + ADD CONSTRAINT arti_reports_pkey PRIMARY KEY (index); + + +-- +-- Name: azureq_2_rabbit_instances azureq_2_rabbit_instances_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.azureq_2_rabbit_instances + ADD CONSTRAINT azureq_2_rabbit_instances_pkey PRIMARY KEY (instance_id); + + +-- +-- Name: deployment_details deployment_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.deployment_details + ADD CONSTRAINT deployment_details_pkey PRIMARY KEY (deployment_id); + + +-- +-- Name: deployment_history deployment_history_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.deployment_history + ADD CONSTRAINT deployment_history_pkey PRIMARY KEY (id); + + +-- +-- Name: deployments deployments_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.deployments + ADD CONSTRAINT deployments_pkey PRIMARY KEY (deployment_id); + + +-- +-- Name: device_first_seen device_first_seen_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.device_first_seen + ADD CONSTRAINT device_first_seen_pkey PRIMARY KEY (device_id); + + +-- +-- Name: devices_last_reads devices_last_reads_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.devices_last_reads + ADD CONSTRAINT devices_last_reads_pkey PRIMARY KEY (device_id); + + +-- +-- Name: devices devices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.devices + ADD CONSTRAINT devices_pkey PRIMARY KEY (device_id); + + +-- +-- Name: devices devices_well_mac_unique; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.devices + ADD CONSTRAINT devices_well_mac_unique UNIQUE (well_id, device_mac); + + +-- +-- Name: disclaimers disclaimers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.disclaimers + ADD CONSTRAINT disclaimers_pkey PRIMARY KEY (id); + + +-- +-- Name: format_contexts format_contexts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.format_contexts + ADD CONSTRAINT format_contexts_pkey PRIMARY KEY (index); + + +-- +-- Name: telnyx_events id; Type: CONSTRAINT; Schema: public; Owner: well_app +-- + +ALTER TABLE ONLY public.telnyx_events + ADD CONSTRAINT id PRIMARY KEY (id); + + +-- +-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_pkey PRIMARY KEY (job_id); + + +-- +-- Name: mobile_clients_messages mobile_clients_messages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.mobile_clients_messages + ADD CONSTRAINT mobile_clients_messages_pkey PRIMARY KEY (id); + + +-- +-- Name: mobile_clients mobile_clients_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.mobile_clients + ADD CONSTRAINT mobile_clients_pkey PRIMARY KEY (mqtt_id); + + +-- +-- Name: node_reds node-reds_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.node_reds + ADD CONSTRAINT "node-reds_pkey" PRIMARY KEY (user_name); + + +-- +-- Name: node_reds_usage node_reds_usage_pkey; Type: CONSTRAINT; Schema: public; Owner: well_app +-- + +ALTER TABLE ONLY public.node_reds_usage + ADD CONSTRAINT node_reds_usage_pkey PRIMARY KEY (index); + + +-- +-- Name: person_details person_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.person_details + ADD CONSTRAINT person_details_pkey PRIMARY KEY (user_id); + + +-- +-- Name: queue_muncher_instances queue_muncher_instances_pkey; Type: CONSTRAINT; Schema: public; Owner: well_app +-- + +ALTER TABLE ONLY public.queue_muncher_instances + ADD CONSTRAINT queue_muncher_instances_pkey PRIMARY KEY (instance_id); + + +-- +-- Name: race race_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.race + ADD CONSTRAINT race_pkey PRIMARY KEY (race_id); + + +-- +-- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.roles + ADD CONSTRAINT roles_pkey PRIMARY KEY (role_id); + + +-- +-- Name: user_tokens unique_token_id; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_tokens + ADD CONSTRAINT unique_token_id UNIQUE (token_id); + + +-- +-- Name: user_topics unique_user_topic; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_topics + ADD CONSTRAINT unique_user_topic UNIQUE (user_name, topic); + + +-- +-- Name: user_tokens user_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_tokens + ADD CONSTRAINT user_tokens_pkey PRIMARY KEY (id); + + +-- +-- Name: user_topics user_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.user_topics + ADD CONSTRAINT user_topics_pkey PRIMARY KEY (id); + + +-- +-- Name: voice_contexts voice_contexts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.voice_contexts + ADD CONSTRAINT voice_contexts_pkey PRIMARY KEY (index); + + +-- +-- Name: _hyper_3_101_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_101_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_101_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_101_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_101_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_101_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_103_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_103_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_103_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_103_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_103_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_103_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_105_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_105_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_105_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_105_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_105_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_105_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_107_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_107_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_107_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_107_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_107_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_107_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_109_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_109_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_109_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_109_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_109_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_109_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_10_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_10_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_10_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_10_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_10_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_10_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_111_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_111_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_111_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_111_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_111_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_111_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_113_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_113_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_113_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_113_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_113_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_113_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_114_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_114_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_114_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_114_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_114_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_114_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_117_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_117_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_117_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_117_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_117_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_117_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_119_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_119_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_119_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_119_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_119_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_119_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_11_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_11_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_11_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_11_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_11_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_11_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_121_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_121_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_121_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_121_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_121_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_121_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_123_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_123_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_123_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_123_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_123_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_123_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_125_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_125_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_125_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_125_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_125_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_125_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_127_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_127_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_127_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_127_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_127_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_127_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_12_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_12_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_12_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_12_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_12_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_12_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_13_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_13_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_13_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_13_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_13_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_13_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_14_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_14_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_14_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_14_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_14_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_14_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_15_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_15_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_15_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_15_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_15_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_15_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_16_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_16_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_16_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_16_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_16_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_16_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_17_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_17_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_17_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_17_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_17_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_17_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_18_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_18_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_18_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_18_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_18_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_18_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_19_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_19_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_19_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_19_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_19_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_19_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_1_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_1_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_1_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_1_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_1_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_1_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_20_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_20_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_20_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_20_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_20_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_20_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_21_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_21_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_21_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_21_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_21_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_21_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_22_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_22_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_22_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_22_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_22_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_22_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_2_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_2_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_2_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_2_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_2_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_2_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_3_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_3_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_3_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_3_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_3_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_3_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_45_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_45_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_45_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_45_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_45_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_45_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_48_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_48_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_48_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_48_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_48_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_48_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_49_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_49_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_49_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_49_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_49_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_49_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_4_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_4_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_4_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_4_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_4_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_4_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_52_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_52_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_52_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_52_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_52_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_52_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_53_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_53_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_53_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_53_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_53_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_53_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_55_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_55_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_55_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_55_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_55_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_55_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_57_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_57_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_57_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_57_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_57_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_57_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_59_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_59_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_59_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_59_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_59_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_59_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_5_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_5_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_5_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_5_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_5_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_5_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_61_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_61_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_61_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_61_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_61_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_61_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_63_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_63_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_63_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_63_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_63_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_63_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_65_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_65_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_65_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_65_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_65_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_65_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_68_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_68_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_68_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_68_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_68_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_68_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_6_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_6_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_6_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_6_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_6_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_6_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_70_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_70_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_70_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_70_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_70_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_70_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_72_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_72_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_72_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_72_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_72_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_72_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_74_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_74_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_74_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_74_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_74_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_74_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_75_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_75_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_75_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_75_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_75_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_75_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_77_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_77_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_77_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_77_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_77_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_77_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_79_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_79_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_79_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_79_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_79_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_79_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_7_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_7_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_7_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_7_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_7_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_7_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_82_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_82_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_82_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_82_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_82_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_82_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_84_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_84_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_84_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_84_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_84_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_84_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_85_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_85_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_85_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_85_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_85_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_85_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_88_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_88_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_88_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_88_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_88_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_88_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_8_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_8_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_8_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_8_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_8_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_8_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_90_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_90_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_90_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_90_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_90_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_90_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_95_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_95_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_95_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_95_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_95_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_95_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_97_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_97_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_97_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_97_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_97_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_97_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_99_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_99_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_99_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_99_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_99_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_99_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_3_9_chunk_idx_unified_radar_device_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_9_chunk_idx_unified_radar_device_utc ON _timescaledb_internal._hyper_3_9_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_3_9_chunk_unified_radar_readings_time_idx_utc; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_3_9_chunk_unified_radar_readings_time_idx_utc ON _timescaledb_internal._hyper_3_9_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_100_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_100_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_100_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_100_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_100_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_100_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_102_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_102_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_102_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_102_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_102_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_102_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_104_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_104_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_104_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_104_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_104_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_104_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_106_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_106_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_106_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_106_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_106_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_106_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_108_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_108_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_108_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_108_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_108_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_108_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_110_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_110_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_110_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_110_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_110_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_110_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_112_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_112_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_112_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_112_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_112_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_112_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_115_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_115_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_115_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_115_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_115_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_115_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_116_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_116_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_116_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_116_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_116_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_116_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_118_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_118_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_118_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_118_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_118_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_118_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_120_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_120_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_120_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_120_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_120_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_120_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_122_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_122_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_122_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_122_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_122_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_122_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_124_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_124_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_124_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_124_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_124_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_124_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_126_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_126_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_126_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_126_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_126_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_126_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_23_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_23_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_23_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_23_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_23_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_23_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_24_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_24_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_24_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_24_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_24_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_24_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_25_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_25_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_25_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_25_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_25_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_25_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_26_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_26_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_26_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_26_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_26_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_26_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_27_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_27_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_27_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_27_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_27_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_27_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_28_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_28_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_28_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_28_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_28_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_28_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_29_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_29_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_29_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_29_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_29_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_29_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_30_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_30_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_30_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_30_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_30_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_30_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_31_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_31_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_31_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_31_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_31_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_31_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_32_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_32_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_32_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_32_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_32_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_32_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_33_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_33_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_33_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_33_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_33_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_33_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_34_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_34_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_34_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_34_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_34_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_34_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_35_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_35_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_35_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_35_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_35_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_35_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_36_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_36_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_36_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_36_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_36_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_36_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_37_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_37_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_37_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_37_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_37_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_37_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_38_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_38_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_38_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_38_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_38_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_38_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_39_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_39_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_39_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_39_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_39_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_39_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_40_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_40_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_40_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_40_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_40_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_40_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_41_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_41_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_41_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_41_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_41_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_41_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_42_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_42_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_42_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_42_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_42_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_42_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_43_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_43_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_43_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_43_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_43_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_43_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_44_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_44_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_44_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_44_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_44_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_44_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_46_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_46_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_46_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_46_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_46_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_46_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_47_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_47_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_47_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_47_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_47_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_47_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_50_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_50_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_50_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_50_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_50_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_50_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_51_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_51_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_51_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_51_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_51_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_51_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_54_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_54_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_54_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_54_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_54_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_54_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_56_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_56_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_56_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_56_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_56_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_56_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_58_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_58_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_58_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_58_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_58_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_58_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_60_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_60_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_60_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_60_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_60_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_60_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_62_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_62_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_62_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_62_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_62_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_62_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_64_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_64_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_64_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_64_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_64_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_64_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_66_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_66_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_66_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_66_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_66_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_66_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_67_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_67_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_67_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_67_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_67_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_67_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_69_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_69_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_69_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_69_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_69_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_69_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_71_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_71_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_71_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_71_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_71_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_71_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_73_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_73_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_73_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_73_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_73_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_73_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_76_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_76_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_76_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_76_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_76_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_76_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_78_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_78_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_78_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_78_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_78_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_78_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_80_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_80_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_80_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_80_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_80_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_80_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_81_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_81_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_81_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_81_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_81_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_81_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_83_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_83_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_83_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_83_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_83_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_83_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_86_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_86_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_86_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_86_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_86_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_86_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_87_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_87_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_87_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_87_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_87_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_87_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_89_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_89_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_89_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_89_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_89_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_89_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_91_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_91_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_91_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_91_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_91_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_91_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_92_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_92_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_92_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_92_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_92_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_92_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_93_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_93_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_93_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_93_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_93_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_93_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_94_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_94_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_94_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_94_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_94_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_94_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_96_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_96_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_96_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_96_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_96_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_96_chunk USING btree ("time" DESC); + + +-- +-- Name: _hyper_4_98_chunk_idx_unified_sensor_device; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_98_chunk_idx_unified_sensor_device ON _timescaledb_internal._hyper_4_98_chunk USING btree (device_id, "time" DESC); + + +-- +-- Name: _hyper_4_98_chunk_unified_sensor_readings_time_idx; Type: INDEX; Schema: _timescaledb_internal; Owner: well_app +-- + +CREATE INDEX _hyper_4_98_chunk_unified_sensor_readings_time_idx ON _timescaledb_internal._hyper_4_98_chunk USING btree ("time" DESC); + + +-- +-- Name: idx_jobs_job_status; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX idx_jobs_job_status ON public.jobs USING btree (job_status); + + +-- +-- Name: idx_unified_radar_device_utc; Type: INDEX; Schema: public; Owner: well_app +-- + +CREATE INDEX idx_unified_radar_device_utc ON public.radar_readings USING btree (device_id, "time" DESC); + + +-- +-- Name: idx_unified_sensor_device; Type: INDEX; Schema: public; Owner: well_app +-- + +CREATE INDEX idx_unified_sensor_device ON public.sensor_readings USING btree (device_id, "time" DESC); + + +-- +-- Name: idx_user_tokens_token_id; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX idx_user_tokens_token_id ON public.user_tokens USING btree (token_id); + + +-- +-- Name: idx_user_tokens_username; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX idx_user_tokens_username ON public.user_tokens USING btree (username); + + +-- +-- Name: idx_user_topics_username; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX idx_user_topics_username ON public.user_topics USING btree (user_name); + + +-- +-- Name: unified_radar_readings_time_idx_utc; Type: INDEX; Schema: public; Owner: well_app +-- + +CREATE INDEX unified_radar_readings_time_idx_utc ON public.radar_readings USING btree ("time" DESC); + + +-- +-- Name: unified_sensor_readings_time_idx; Type: INDEX; Schema: public; Owner: well_app +-- + +CREATE INDEX unified_sensor_readings_time_idx ON public.sensor_readings USING btree ("time" DESC); + + +-- +-- Name: radar_readings ts_insert_blocker; Type: TRIGGER; Schema: public; Owner: well_app +-- + +CREATE TRIGGER ts_insert_blocker BEFORE INSERT ON public.radar_readings FOR EACH ROW EXECUTE FUNCTION _timescaledb_functions.insert_blocker(); + + +-- +-- Name: sensor_readings ts_insert_blocker; Type: TRIGGER; Schema: public; Owner: well_app +-- + +CREATE TRIGGER ts_insert_blocker BEFORE INSERT ON public.sensor_readings FOR EACH ROW EXECUTE FUNCTION _timescaledb_functions.insert_blocker(); + + +-- +-- Name: jobs jobs_mitigation_person_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_mitigation_person_id_fkey FOREIGN KEY (mitigation_person_id) REFERENCES public.person_details(user_id); + + +-- +-- Name: jobs jobs_user_edit_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.jobs + ADD CONSTRAINT jobs_user_edit_fkey FOREIGN KEY (user_edit) REFERENCES public.person_details(user_id); + + +-- +-- Name: FUNCTION add_compression_policy(hypertable regclass, compress_after "any", if_not_exists boolean, schedule_interval interval, initial_start timestamp with time zone, timezone text, compress_created_before interval, hypercore_use_access_method boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_compression_policy(hypertable regclass, compress_after "any", if_not_exists boolean, schedule_interval interval, initial_start timestamp with time zone, timezone text, compress_created_before interval, hypercore_use_access_method boolean) TO well_app; + + +-- +-- Name: FUNCTION add_continuous_aggregate_policy(continuous_aggregate regclass, start_offset "any", end_offset "any", schedule_interval interval, if_not_exists boolean, initial_start timestamp with time zone, timezone text, include_tiered_data boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_continuous_aggregate_policy(continuous_aggregate regclass, start_offset "any", end_offset "any", schedule_interval interval, if_not_exists boolean, initial_start timestamp with time zone, timezone text, include_tiered_data boolean) TO well_app; + + +-- +-- Name: FUNCTION add_dimension(hypertable regclass, dimension _timescaledb_internal.dimension_info, if_not_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_dimension(hypertable regclass, dimension _timescaledb_internal.dimension_info, if_not_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION add_dimension(hypertable regclass, column_name name, number_partitions integer, chunk_time_interval anyelement, partitioning_func regproc, if_not_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_dimension(hypertable regclass, column_name name, number_partitions integer, chunk_time_interval anyelement, partitioning_func regproc, if_not_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION add_job(proc regproc, schedule_interval interval, config jsonb, initial_start timestamp with time zone, scheduled boolean, check_config regproc, fixed_schedule boolean, timezone text); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_job(proc regproc, schedule_interval interval, config jsonb, initial_start timestamp with time zone, scheduled boolean, check_config regproc, fixed_schedule boolean, timezone text) TO well_app; + + +-- +-- Name: FUNCTION add_reorder_policy(hypertable regclass, index_name name, if_not_exists boolean, initial_start timestamp with time zone, timezone text); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_reorder_policy(hypertable regclass, index_name name, if_not_exists boolean, initial_start timestamp with time zone, timezone text) TO well_app; + + +-- +-- Name: FUNCTION add_retention_policy(relation regclass, drop_after "any", if_not_exists boolean, schedule_interval interval, initial_start timestamp with time zone, timezone text, drop_created_before interval); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.add_retention_policy(relation regclass, drop_after "any", if_not_exists boolean, schedule_interval interval, initial_start timestamp with time zone, timezone text, drop_created_before interval) TO well_app; + + +-- +-- Name: FUNCTION alter_job(job_id integer, schedule_interval interval, max_runtime interval, max_retries integer, retry_period interval, scheduled boolean, config jsonb, next_start timestamp with time zone, if_exists boolean, check_config regproc, fixed_schedule boolean, initial_start timestamp with time zone, timezone text); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.alter_job(job_id integer, schedule_interval interval, max_runtime interval, max_retries integer, retry_period interval, scheduled boolean, config jsonb, next_start timestamp with time zone, if_exists boolean, check_config regproc, fixed_schedule boolean, initial_start timestamp with time zone, timezone text) TO well_app; + + +-- +-- Name: FUNCTION approximate_row_count(relation regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.approximate_row_count(relation regclass) TO well_app; + + +-- +-- Name: FUNCTION attach_tablespace(tablespace name, hypertable regclass, if_not_attached boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.attach_tablespace(tablespace name, hypertable regclass, if_not_attached boolean) TO well_app; + + +-- +-- Name: FUNCTION by_hash(column_name name, number_partitions integer, partition_func regproc); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.by_hash(column_name name, number_partitions integer, partition_func regproc) TO well_app; + + +-- +-- Name: FUNCTION by_range(column_name name, partition_interval anyelement, partition_func regproc); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.by_range(column_name name, partition_interval anyelement, partition_func regproc) TO well_app; + + +-- +-- Name: FUNCTION chunk_columnstore_stats(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.chunk_columnstore_stats(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION chunk_compression_stats(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.chunk_compression_stats(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION chunks_detailed_size(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.chunks_detailed_size(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION compress_chunk(uncompressed_chunk regclass, if_not_compressed boolean, recompress boolean, hypercore_use_access_method boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.compress_chunk(uncompressed_chunk regclass, if_not_compressed boolean, recompress boolean, hypercore_use_access_method boolean) TO well_app; + + +-- +-- Name: FUNCTION create_hypertable(relation regclass, dimension _timescaledb_internal.dimension_info, create_default_indexes boolean, if_not_exists boolean, migrate_data boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.create_hypertable(relation regclass, dimension _timescaledb_internal.dimension_info, create_default_indexes boolean, if_not_exists boolean, migrate_data boolean) TO well_app; + + +-- +-- Name: FUNCTION create_hypertable(relation regclass, time_column_name name, partitioning_column name, number_partitions integer, associated_schema_name name, associated_table_prefix name, chunk_time_interval anyelement, create_default_indexes boolean, if_not_exists boolean, partitioning_func regproc, migrate_data boolean, chunk_target_size text, chunk_sizing_func regproc, time_partitioning_func regproc); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.create_hypertable(relation regclass, time_column_name name, partitioning_column name, number_partitions integer, associated_schema_name name, associated_table_prefix name, chunk_time_interval anyelement, create_default_indexes boolean, if_not_exists boolean, partitioning_func regproc, migrate_data boolean, chunk_target_size text, chunk_sizing_func regproc, time_partitioning_func regproc) TO well_app; + + +-- +-- Name: FUNCTION decompress_chunk(uncompressed_chunk regclass, if_compressed boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.decompress_chunk(uncompressed_chunk regclass, if_compressed boolean) TO well_app; + + +-- +-- Name: FUNCTION delete_job(job_id integer); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.delete_job(job_id integer) TO well_app; + + +-- +-- Name: FUNCTION detach_tablespace(tablespace name, hypertable regclass, if_attached boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.detach_tablespace(tablespace name, hypertable regclass, if_attached boolean) TO well_app; + + +-- +-- Name: FUNCTION detach_tablespaces(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.detach_tablespaces(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION disable_chunk_skipping(hypertable regclass, column_name name, if_not_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.disable_chunk_skipping(hypertable regclass, column_name name, if_not_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION drop_chunks(relation regclass, older_than "any", newer_than "any", "verbose" boolean, created_before "any", created_after "any"); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.drop_chunks(relation regclass, older_than "any", newer_than "any", "verbose" boolean, created_before "any", created_after "any") TO well_app; + + +-- +-- Name: FUNCTION enable_chunk_skipping(hypertable regclass, column_name name, if_not_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.enable_chunk_skipping(hypertable regclass, column_name name, if_not_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION hypertable_approximate_detailed_size(relation regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_approximate_detailed_size(relation regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_approximate_size(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_approximate_size(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_columnstore_stats(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_columnstore_stats(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_compression_stats(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_compression_stats(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_detailed_size(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_detailed_size(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_index_size(index_name regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_index_size(index_name regclass) TO well_app; + + +-- +-- Name: FUNCTION hypertable_size(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.hypertable_size(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION interpolate(value real, prev record, next record); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.interpolate(value real, prev record, next record) TO well_app; + + +-- +-- Name: FUNCTION interpolate(value double precision, prev record, next record); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.interpolate(value double precision, prev record, next record) TO well_app; + + +-- +-- Name: FUNCTION interpolate(value smallint, prev record, next record); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.interpolate(value smallint, prev record, next record) TO well_app; + + +-- +-- Name: FUNCTION interpolate(value integer, prev record, next record); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.interpolate(value integer, prev record, next record) TO well_app; + + +-- +-- Name: FUNCTION interpolate(value bigint, prev record, next record); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.interpolate(value bigint, prev record, next record) TO well_app; + + +-- +-- Name: FUNCTION locf(value anyelement, prev anyelement, treat_null_as_missing boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.locf(value anyelement, prev anyelement, treat_null_as_missing boolean) TO well_app; + + +-- +-- Name: FUNCTION move_chunk(chunk regclass, destination_tablespace name, index_destination_tablespace name, reorder_index regclass, "verbose" boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.move_chunk(chunk regclass, destination_tablespace name, index_destination_tablespace name, reorder_index regclass, "verbose" boolean) TO well_app; + + +-- +-- Name: FUNCTION remove_compression_policy(hypertable regclass, if_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.remove_compression_policy(hypertable regclass, if_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION remove_continuous_aggregate_policy(continuous_aggregate regclass, if_not_exists boolean, if_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.remove_continuous_aggregate_policy(continuous_aggregate regclass, if_not_exists boolean, if_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION remove_reorder_policy(hypertable regclass, if_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.remove_reorder_policy(hypertable regclass, if_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION remove_retention_policy(relation regclass, if_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.remove_retention_policy(relation regclass, if_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION reorder_chunk(chunk regclass, index regclass, "verbose" boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.reorder_chunk(chunk regclass, index regclass, "verbose" boolean) TO well_app; + + +-- +-- Name: FUNCTION set_adaptive_chunking(hypertable regclass, chunk_target_size text, INOUT chunk_sizing_func regproc, OUT chunk_target_size bigint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.set_adaptive_chunking(hypertable regclass, chunk_target_size text, INOUT chunk_sizing_func regproc, OUT chunk_target_size bigint) TO well_app; + + +-- +-- Name: FUNCTION set_chunk_time_interval(hypertable regclass, chunk_time_interval anyelement, dimension_name name); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.set_chunk_time_interval(hypertable regclass, chunk_time_interval anyelement, dimension_name name) TO well_app; + + +-- +-- Name: FUNCTION set_integer_now_func(hypertable regclass, integer_now_func regproc, replace_if_exists boolean); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.set_integer_now_func(hypertable regclass, integer_now_func regproc, replace_if_exists boolean) TO well_app; + + +-- +-- Name: FUNCTION set_number_partitions(hypertable regclass, number_partitions integer, dimension_name name); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.set_number_partitions(hypertable regclass, number_partitions integer, dimension_name name) TO well_app; + + +-- +-- Name: FUNCTION set_partitioning_interval(hypertable regclass, partition_interval anyelement, dimension_name name); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.set_partitioning_interval(hypertable regclass, partition_interval anyelement, dimension_name name) TO well_app; + + +-- +-- Name: FUNCTION show_chunks(relation regclass, older_than "any", newer_than "any", created_before "any", created_after "any"); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.show_chunks(relation regclass, older_than "any", newer_than "any", created_before "any", created_after "any") TO well_app; + + +-- +-- Name: FUNCTION show_tablespaces(hypertable regclass); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.show_tablespaces(hypertable regclass) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width smallint, ts smallint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width smallint, ts smallint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width integer, ts integer); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width integer, ts integer) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width bigint, ts bigint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width bigint, ts bigint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts date); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts date) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp without time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp without time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp with time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp with time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width smallint, ts smallint, "offset" smallint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width smallint, ts smallint, "offset" smallint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width integer, ts integer, "offset" integer); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width integer, ts integer, "offset" integer) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width bigint, ts bigint, "offset" bigint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width bigint, ts bigint, "offset" bigint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts date, origin date); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts date, origin date) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts date, "offset" interval); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts date, "offset" interval) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp without time zone, "offset" interval); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp without time zone, "offset" interval) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp without time zone, origin timestamp without time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp without time zone, origin timestamp without time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp with time zone, "offset" interval); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp with time zone, "offset" interval) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp with time zone, origin timestamp with time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp with time zone, origin timestamp with time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket(bucket_width interval, ts timestamp with time zone, timezone text, origin timestamp with time zone, "offset" interval); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket(bucket_width interval, ts timestamp with time zone, timezone text, origin timestamp with time zone, "offset" interval) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width smallint, ts smallint, start smallint, finish smallint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width smallint, ts smallint, start smallint, finish smallint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width integer, ts integer, start integer, finish integer); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width integer, ts integer, start integer, finish integer) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width bigint, ts bigint, start bigint, finish bigint); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width bigint, ts bigint, start bigint, finish bigint) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width interval, ts date, start date, finish date); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width interval, ts date, start date, finish date) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width interval, ts timestamp without time zone, start timestamp without time zone, finish timestamp without time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width interval, ts timestamp without time zone, start timestamp without time zone, finish timestamp without time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width interval, ts timestamp with time zone, start timestamp with time zone, finish timestamp with time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width interval, ts timestamp with time zone, start timestamp with time zone, finish timestamp with time zone) TO well_app; + + +-- +-- Name: FUNCTION time_bucket_gapfill(bucket_width interval, ts timestamp with time zone, timezone text, start timestamp with time zone, finish timestamp with time zone); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.time_bucket_gapfill(bucket_width interval, ts timestamp with time zone, timezone text, start timestamp with time zone, finish timestamp with time zone) TO well_app; + + +-- +-- Name: FUNCTION timescaledb_post_restore(); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.timescaledb_post_restore() TO well_app; + + +-- +-- Name: FUNCTION timescaledb_pre_restore(); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.timescaledb_pre_restore() TO well_app; + + +-- +-- Name: FUNCTION first(anyelement, "any"); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.first(anyelement, "any") TO well_app; + + +-- +-- Name: FUNCTION histogram(double precision, double precision, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.histogram(double precision, double precision, double precision, integer) TO well_app; + + +-- +-- Name: FUNCTION last(anyelement, "any"); Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON FUNCTION public.last(anyelement, "any") TO well_app; + + +-- +-- Name: TABLE alarms_voice; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.alarms_voice TO well_app; + + +-- +-- Name: TABLE arti_reports; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.arti_reports TO well_app; + + +-- +-- Name: SEQUENCE arti_reports_index_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.arti_reports_index_seq TO well_app; + + +-- +-- Name: TABLE azureq_2_rabbit_instances; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.azureq_2_rabbit_instances TO well_app; + + +-- +-- Name: TABLE deployment_details; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.deployment_details TO well_app; + + +-- +-- Name: SEQUENCE deployment_history_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.deployment_history_id_seq TO well_app; + + +-- +-- Name: TABLE deployment_history; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.deployment_history TO well_app; + + +-- +-- Name: TABLE deployments; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.deployments TO well_app; + + +-- +-- Name: SEQUENCE deployments_deployment_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.deployments_deployment_id_seq TO well_app; + + +-- +-- Name: TABLE device_first_seen; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.device_first_seen TO well_app; + + +-- +-- Name: TABLE devices; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.devices TO well_app; + + +-- +-- Name: SEQUENCE devices_device_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.devices_device_id_seq TO well_app; + + +-- +-- Name: TABLE devices_last_reads; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.devices_last_reads TO well_app; + + +-- +-- Name: TABLE disclaimers; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.disclaimers TO well_app; + + +-- +-- Name: SEQUENCE disclaimers_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.disclaimers_id_seq TO well_app; + + +-- +-- Name: SEQUENCE format_contexts_index_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.format_contexts_index_seq TO well_app; + + +-- +-- Name: TABLE jobs; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.jobs TO well_app; + + +-- +-- Name: SEQUENCE jobs_job_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.jobs_job_id_seq TO well_app; + + +-- +-- Name: TABLE mobile_clients; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.mobile_clients TO well_app; + + +-- +-- Name: TABLE mobile_clients_messages; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.mobile_clients_messages TO well_app; + + +-- +-- Name: SEQUENCE mobile_clients_messages_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.mobile_clients_messages_id_seq TO well_app; + + +-- +-- Name: TABLE node_reds; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.node_reds TO well_app; + + +-- +-- Name: TABLE person_details; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.person_details TO well_app; + + +-- +-- Name: SEQUENCE person_details_person_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.person_details_person_id_seq TO well_app; + + +-- +-- Name: TABLE race; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.race TO well_app; + + +-- +-- Name: TABLE roles; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.roles TO well_app; + + +-- +-- Name: TABLE user_tokens; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.user_tokens TO well_app; + + +-- +-- Name: SEQUENCE user_tokens_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.user_tokens_id_seq TO well_app; + + +-- +-- Name: TABLE user_topics; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON TABLE public.user_topics TO well_app; + + +-- +-- Name: SEQUENCE user_topics_id_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT ALL ON SEQUENCE public.user_topics_id_seq TO well_app; + + +-- +-- Name: SEQUENCE voice_contexts_index_seq; Type: ACL; Schema: public; Owner: postgres +-- + +GRANT SELECT,USAGE ON SEQUENCE public.voice_contexts_index_seq TO well_app; + + +-- +-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: postgres +-- + +ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT SELECT,USAGE ON SEQUENCES TO well_app; + + +-- +-- PostgreSQL database dump complete +-- + +\unrestrict nEgDhKD6B4nWaKSvB1ltprY3sHDNBEhrNLwMHP5zWu9gM4hHDn5zuiRnbZjRlH7 + diff --git a/test_device_list.sh b/test_device_list.sh new file mode 100644 index 0000000..11b7a0b --- /dev/null +++ b/test_device_list.sh @@ -0,0 +1,354 @@ +#!/bin/bash + +# ============================================================================== +# WellDrySense API Test Suite (Bash Version) +# Functionality: Exercises Job APIs including Create, List, Edit, Details, Weather, +# Sensor Data, and performs Database Cleanup. +# ============================================================================== + +# --- Configuration --- +# Load .env file if it exists +if [ -f .env ]; then + export $(cat .env | xargs) +fi + +# Defaults (can be overridden by env vars) +PORT="${PORT:-8002}" +BASE_URL="http://localhost:$PORT/api/well_api" +#API_USER="${API_USER:-jpeters}" +#API_PASSWORD="${API_PASSWORD:-WellJson}" +API_USER="${API_USER:-brankol}" +API_PASSWORD="${API_PASSWORD:-branko_2025!}" +DB_NAME="${DB_NAME:-wellnuo}" +DB_USER="${DB_USER:-postgres}" +DB_HOST="${DB_HOST:-localhost}" +DB_PORT="${DB_PORT:-5432}" +# DB_PASSWORD should be set in .env or exported + +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Global Variables +TOKEN="" +USER_ID="" +JOB_ID="" + +# Check for jq +if ! command -v jq &> /dev/null; then + echo -e "${RED}Error: 'jq' is not installed. Please install it to run this script.${NC}" + exit 1 +fi + +echo -e "${BLUE}=== Setting up WellDrySense Test Suite on Port $PORT ===${NC}" + +# ============================================================================== +# Helper Functions +# ============================================================================== + +# Function to print section headers +print_header() { + echo -e "\n${BLUE}----------------------------------------------------------------${NC}" + echo -e "${BLUE}[Test] $1${NC}" +} + +# Function to perform a POST request +# Usage: perform_test "Test Name" "JSON_PAYLOAD_STRING" +perform_test() { + local test_name="$1" + local json_payload="$2" + + print_header "$test_name" + + # 1. Print Request + echo "# Request:" + echo "$json_payload" | jq '.' + + # 2. Convert JSON to Form Data for curl (flattening simple objects) + # Note: This simple conversion handles top-level keys. + # Complex nested JSON strings (like 'devices') need to be passed as strings in the input JSON. + local form_data="" + + # Extract keys and values and build form string + while IFS="=" read -r key value; do + if [ -n "$key" ]; then + # URL encode the value + encoded_value=$(printf '%s' "$value" | jq -sRr @uri) + if [ -z "$form_data" ]; then + form_data="${key}=${encoded_value}" + else + form_data="${form_data}&${key}=${encoded_value}" + fi + fi + done < <(echo "$json_payload" | jq -r "to_entries|map(\"\(.key)=\(.value)\")|.[]") + + # 3. Execute Request + response=$(curl -s -X POST "$BASE_URL" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "$form_data") + + # 4. Print Response + echo -e "\n# Response:" + if [ -z "$response" ]; then + echo "(Empty Response)" + echo -e "${RED}FAIL${NC}" + return 1 + else + echo "$response" | jq '.' 2>/dev/null || echo "$response" + fi + + # 5. Evaluate Pass/Fail based on "ok": 1 + ok_val=$(echo "$response" | jq -r '.ok // .status // 0') + + # Handle different response structures (some return {status: 200}, some {ok: 1}) + if [ "$ok_val" == "1" ] || [ "$ok_val" == "200" ] || [ "$ok_val" == "success" ]; then + echo -e "${GREEN}PASS${NC}" + + # Extract Job ID if this was the create step + if [ "$test_name" == "job_create" ]; then + JOB_ID=$(echo "$response" | jq -r '.job_id') + echo "-> Captured Job ID: $JOB_ID" + fi + return 0 + else + error_msg=$(echo "$response" | jq -r '.error // .message // "Unknown error"') + echo -e "${RED}FAIL: $error_msg${NC}" + return 1 + fi +} + +# ============================================================================== +# Test Execution +# ============================================================================== + +# 1. Login / Credentials +# ---------------------- +login_payload=$(jq -n \ + --arg fn "credentials" \ + --arg un "$API_USER" \ + --arg ps "$API_PASSWORD" \ + --arg cid "bash-suite" \ + --arg nonce "test-nonce" \ + '{function: $fn, user_name: $un, ps: $ps, clientId: $cid, nonce: $nonce}') + +print_header "Login" +echo "# Request:" +echo "$login_payload" | jq '.' + +# Special handling for login to capture token +response=$(curl -s -X POST "$BASE_URL" -d "function=credentials&user_name=$API_USER&ps=$API_PASSWORD&clientId=bash-suite&nonce=test-nonce") + +echo -e "\n# Response:" +echo "$response" | jq '.' + +TOKEN=$(echo "$response" | jq -r '.access_token // .data.access_token') +USER_ID=$(echo "$response" | jq -r '.user_id // .data.user_id') + +if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then + echo -e "${GREEN}PASS${NC} (User ID: $USER_ID)" +else + echo -e "${RED}FATAL: Login failed. Check credentials.${NC}" + exit 1 +fi + +# # 2. Create Job +# # ---------------------- +# # Note: We pass JSON strings for complex fields like 'devices' and 'alerts_config' +# devices_json='[{"mac": "TEST_MAC_VIRTUAL", "location": "Lab"}]' +# alerts_json='{"temp_high": 30}' + +# create_payload=$(jq -n \ +# --arg fn "job_create" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg cn "TEST_SUITE_CUSTOMER_BASH" \ +# --arg as "123 Bash Script Ln" \ +# --arg ac "Shellville" \ +# --arg dev "$devices_json" \ +# --arg lat "34.05" \ +# --arg lng "-118.25" \ +# '{function: $fn, user_name: $un, token: $tk, customer_name: $cn, address_street: $as, address_city: $ac, devices: $dev, lat: $lat, lng: $lng}') + +# perform_test "job_create" "$create_payload" || exit 1 + +# # 3. Job List +# # ---------------------- +# list_payload=$(jq -n \ +# --arg fn "job_list" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# '{function: $fn, user_name: $un, token: $tk}') + +# perform_test "job_list" "$list_payload" + +# # 3. Job List 2 (with added search) +# # ---------------------- +# list_payload=$(jq -n \ +# --arg fn "job_list2" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg sch "" \ +# '{function: $fn, user_name: $un, token: $tk, search: $sch}') + +# perform_test "job_list2" "$list_payload" + +# # 4. Job Details +# # ---------------------- +# details_payload=$(jq -n \ +# --arg fn "job_details" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +# perform_test "job_details" "$details_payload" + +# # 5. Job Edit (Stop Job) +# # ---------------------- +# edit_payload=$(jq -n \ +# --arg fn "job_edit" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# --arg st "Stopped" \ +# --arg dt "2025-12-31T23:59:59" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid, job_status: $st, date_to: $dt}') + +# perform_test "job_edit" "$edit_payload" + +# # 6. Available Devices (two versions, with direct SQL and via GetProximityList) +# # ---------------------- +# avail_payload=$(jq -n \ +# --arg fn "job_available_devices" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# '{function: $fn, user_name: $un, token: $tk}') + +# perform_test "job_available_devices" "$avail_payload" + +# # 6. Available Devices (Alternative Test using job_available_devices2, which is using GetProximityList) +# avail_payload=$(jq -n \ +# --arg fn "job_available_devices2" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# '{function: $fn, user_name: $un, token: $tk}') + +# perform_test "job_available_devices2" "$avail_payload" + +# # 6. Available Devices(made reusing job_user_all_devices2, adding filter and search) +# avail_payload=$(jq -n \ +# --arg fn "job_devices" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg fl "all" \ +# --arg sch "" \ +# '{function: $fn, user_name: $un, token: $tk, filter: $fl, search: $sch}') + +# perform_test "job_devices" "$avail_payload" + +# # 7. Job Weather +# # ---------------------- +# weather_payload=$(jq -n \ +# --arg fn "job_weather" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +# perform_test "job_weather" "$weather_payload" + +# # 8. Job Sensor Bucketed Data (New Test) +# # ---------------------- +# # Using dynamic dates for the test +# DATE_FROM=$(date +%Y-%m-%d) +# DATE_TO=$(date +%Y-%m-%d) + +# sensor_payload=$(jq -n \ +# --arg fn "get_job_sensor_bucketed_data" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg jid "$JOB_ID" \ +# --arg sens "temperature" \ +# --arg dt "$DATE_FROM" \ +# --arg dtt "$DATE_TO" \ +# --arg bs "15m" \ +# '{function: $fn, user_name: $un, token: $tk, job_id: $jid, sensor: $sens, date: $dt, to_date: $dtt, bucket_size: $bs}') + +# perform_test "get_job_sensor_bucketed_data" "$sensor_payload" + +# 9. device_list (New Test) +# based on name=devices_list +# &token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJvYnN0ZXIiLCJleHAiOjE3NjQ3OTYwNzh9.t9rKVDRpSYOZGJMm2G0HYKSOOeaLypKwRGIJHehJBFE +# &user_id=32 +# &user_name=robster +# &first=0 +# &last=1000 +# &privileges=-1 +# +# robster test +device_list_payload=$(jq -n \ + --arg fn "devices_list" \ + --arg fid "0" \ + --arg lid "1000" \ + --arg priv "-1" \ + --arg uid "32" \ + --arg un "robster" \ + --arg tk "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJvYnN0ZXIiLCJleHAiOjE3NjQ3OTYwNzh9.t9rKVDRpSYOZGJMm2G0HYKSOOeaLypKwRGIJHehJBFE" \ + '{function: $fn, name: $fn, user_id: $uid, user_name: $un, token: $tk, first: $fid, last: $lid, privileges: $priv}') +perform_test "devices_list" "$device_list_payload" +# brankol test +device_list_payload=$(jq -n \ + --arg fn "devices_list" \ + --arg fid "0" \ + --arg lid "1000" \ + --arg priv "-1" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, name: $fn, user_name: $un, token: $tk, first: $fid, last: $lid, privileges: $priv}') + # --arg uid "32" \ + # --arg un "robster" \ + # --arg tk "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InJvYnN0ZXIiLCJleHAiOjE3NjQ3OTYwNzh9.t9rKVDRpSYOZGJMm2G0HYKSOOeaLypKwRGIJHehJBFE" \ + #'{name: $fn, user_id: $uid, user_name: $un, token: $tk, first: $fid, last: $lid, privileges: $priv}') +perform_test "devices_list" "$device_list_payload" + + +# device_list_payload=$(jq -n \ +# --arg fn "devices_list" \ +# --arg un "$API_USER" \ +# --arg tk "$TOKEN" \ +# --arg fid "0" \ +# --arg lid "1000" \ +# --arg priv "-1" \ +# '{function: $fn, user_name: $un, token: $tk, first: $fid, last: $lid, privileges: $priv}') +# perform_test "devices_list" "$device_list_payload" + +# # ============================================================================== +# # Cleanup +# # ============================================================================== +# print_header "Cleanup" + +# if [ -n "$JOB_ID" ]; then +# echo "-> Deleting Job ID: $JOB_ID from database..." + +# # Use PGPASSWORD for non-interactive auth if set +# export PGPASSWORD="${DB_PASSWORD}" + +# psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c "DELETE FROM public.jobs WHERE job_id = $JOB_ID;" > /dev/null 2>&1 + +# if [ $? -eq 0 ]; then +# echo -e "${GREEN}Cleanup successful. Database restored.${NC}" +# else +# echo -e "${RED}Cleanup failed. Please manually delete job_id $JOB_ID from public.jobs.${NC}" +# echo "Command attempted: psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \"DELETE FROM public.jobs WHERE job_id = $JOB_ID;\"" +# fi +# else +# echo "No Job ID created, skipping cleanup." +# fi + + +echo -e "\n${BLUE}=== Test Suite Finished ===${NC}" +# ============================================================================== +# well-api.py modifications to support WellDrySense API on port 1998 +# ============================================================================== \ No newline at end of file diff --git a/test_welldrysense_api.py b/test_welldrysense_api.py new file mode 100644 index 0000000..fe0e10c --- /dev/null +++ b/test_welldrysense_api.py @@ -0,0 +1,261 @@ +#!/usr/bin/env python3 +import unittest +import requests +import os +import json +import psycopg2 +import sys +import time +from dotenv import load_dotenv + +# --- Configuration --- +# Load environment variables from .env file in the same directory +load_dotenv() + +# Configuration with fallbacks +PORT = os.getenv('PORT', '8002') +BASE_URL = f"http://localhost:{PORT}" +API_USER = os.getenv('API_USER', 'jpeters') +API_PASSWORD = os.getenv('API_PASSWORD', 'WellJson') + +# ANSI Colors for better readability +GREEN = '\033[92m' +RED = '\033[91m' +YELLOW = '\033[93m' +RESET = '\033[0m' + +class TestWellDrySenseAPI(unittest.TestCase): + """ + Test suite for WellDrySense. + Ensures zero-impact on existing data by cleaning up created records. + """ + + token = None + user_id = None + job_id_to_test = None + db_conn_params = {} + + @classmethod + def setUpClass(cls): + print(f"\n{GREEN}=== Setting up WellDrySense Test Suite on Port {PORT} ==={RESET}") + + # Setup DB Params + cls.db_conn_params = { + 'dbname': os.getenv('DB_NAME'), + 'user': os.getenv('DB_USER'), + 'password': os.getenv('DB_PASSWORD'), + 'host': os.getenv('DB_HOST'), + 'port': os.getenv('DB_PORT') + } + + # Authenticate + print(f"-> Logging in as: {API_USER}...") + url = f"{BASE_URL}/api/well_api" + payload = { + "function": "credentials", + "user_name": API_USER, + "ps": API_PASSWORD, + "clientId": "test-suite", + "nonce": "test-nonce" + } + + try: + response = requests.post(url, data=payload) + if response.status_code != 200: + print(f"{RED}FATAL: Login failed. Status: {response.status_code}{RESET}") + print(f"Response: {response.text}") + sys.exit(1) + + data = response.json() + + # Handle different response structures + if 'access_token' in data: + cls.token = data['access_token'] + cls.user_id = data.get('user_id') + elif 'data' in data and 'access_token' in data['data']: + cls.token = data['data']['access_token'] + cls.user_id = data['data'].get('user_id') + else: + print(f"{RED}FATAL: Token not found in response.{RESET}") + sys.exit(1) + + print(f"{GREEN}-> Login successful. User ID: {cls.user_id}{RESET}") + + except requests.exceptions.ConnectionError: + print(f"{RED}FATAL: Could not connect to {BASE_URL}. Ensure well-api.py is running.{RESET}") + sys.exit(1) + + @classmethod + def tearDownClass(cls): + print(f"\n{GREEN}=== Tearing Down Test Suite ==={RESET}") + if cls.job_id_to_test: + print(f"-> Cleaning up Job ID: {cls.job_id_to_test}...") + conn = None + try: + conn = psycopg2.connect(**cls.db_conn_params) + with conn.cursor() as cur: + cur.execute("DELETE FROM public.jobs WHERE job_id = %s;", (cls.job_id_to_test,)) + conn.commit() + print(f"{GREEN}-> Cleanup successful. Database restored.{RESET}") + except Exception as e: + print(f"{RED}CRITICAL: DB Cleanup failed. Manually delete job {cls.job_id_to_test}. Error: {e}{RESET}") + finally: + if conn: conn.close() + else: + print("-> No job created, skipping cleanup.") + + def _post_api(self, form_data): + """Helper to send authenticated POST requests""" + form_data['user_name'] = API_USER + form_data['token'] = self.token + + try: + response = requests.post(f"{BASE_URL}/api/well_api", data=form_data) + self.assertEqual(response.status_code, 200, f"API HTTP Error {response.status_code}: {response.text}") + + try: + json_resp = response.json() + if 'data' in json_resp and 'status' in json_resp: + return json_resp['data'] + return json_resp + except json.JSONDecodeError: + self.fail(f"API returned invalid JSON: {response.text}") + except requests.exceptions.ConnectionError: + self.fail("Connection refused. API server is down.") + + # --- TESTS --- + + def test_01_create_job(self): + """Test creating a new job""" + print("\n[Test] job_create") + payload = { + "function": "job_create", + "customer_name": "TEST_SUITE_CUSTOMER", + "address_street": "123 Python Way", + "address_city": "Codeville", + "address_state": "CA", + "address_country": "USA", + "lat": 34.05, + "lng": -118.25, + "key_person_name": "Test Runner", + "key_person_email": "test@wellnuo.com", + "devices": json.dumps([{"mac": "TEST_MAC_VIRTUAL", "location": "Lab"}]), + "alerts_config": json.dumps({"temp_high": 30}) + } + + data = self._post_api(payload) + self.assertEqual(data.get('ok'), 1, f"Job creation failed: {data.get('error')}") + self.assertIn('job_id', data) + self.__class__.job_id_to_test = data['job_id'] + print(f"-> Job created with ID: {self.job_id_to_test}") + + def test_02_job_list(self): + """Test retrieving the job list""" + print("\n[Test] job_list") + payload = {"function": "job_list"} + data = self._post_api(payload) + + self.assertEqual(data.get('ok'), 1, f"List failed: {data.get('error')}") + self.assertIn('jobs', data) + + found = any(j.get('job_id') == self.job_id_to_test for j in data['jobs']) + self.assertTrue(found, f"Created Job ID {self.job_id_to_test} not found in job_list") + + def test_03_job_details(self): + """Test retrieving single job details""" + print("\n[Test] job_details") + if not self.job_id_to_test: self.skipTest("No job ID available") + + payload = {"function": "job_details", "job_id": self.job_id_to_test} + data = self._post_api(payload) + + self.assertEqual(data.get('ok'), 1, f"Details failed: {data.get('error')}") + self.assertEqual(data['details']['customer_name'], "TEST_SUITE_CUSTOMER") + + # Verify JSON parsing of devices + devices = data['details'].get('devices') + if isinstance(devices, str): devices = json.loads(devices) + self.assertEqual(devices[0]['mac'], "TEST_MAC_VIRTUAL") + + def test_04_job_edit(self): + """Test updating a job (Stop the job)""" + print("\n[Test] job_edit") + if not self.job_id_to_test: self.skipTest("No job ID available") + + payload = { + "function": "job_edit", + "job_id": self.job_id_to_test, + "customer_name": "UPDATED_CUSTOMER_NAME", + "job_status": "Stopped", + "date_to": "2025-12-31T23:59:59" + } + data = self._post_api(payload) + self.assertEqual(data.get('ok'), 1, f"Edit failed: {data.get('error')}") + + # Verify + v_payload = {"function": "job_details", "job_id": self.job_id_to_test} + v_data = self._post_api(v_payload) + self.assertEqual(v_data['details']['customer_name'], "UPDATED_CUSTOMER_NAME") + self.assertEqual(v_data['details']['job_status'], "Stopped") + + def test_05_available_devices(self): + """Test fetching available devices""" + print("\n[Test] job_available_devices") + payload = {"function": "job_available_devices"} + data = self._post_api(payload) + self.assertEqual(data.get('ok'), 1, f"Available devices failed: {data.get('error')}") + self.assertIsInstance(data['devices'], list) + + def test_06_job_weather(self): + """Test fetching weather""" + print("\n[Test] job_weather") + if not self.job_id_to_test: self.skipTest("No job ID available") + + #if not os.getenv('WEATHER_API_KEY'): print(f"{YELLOW}-> Warning: WEATHER_API_KEY not found in .env{RESET}") + + payload = {"function": "job_weather", "job_id": self.job_id_to_test} + data = self._post_api(payload) + + if data.get('ok') == 0: + print(f"-> Weather API returned error (Expected if key invalid): {data.get('error')}") + else: + self.assertIn('weather', data) + print(f"-> Weather received: {data['weather']}") + + def test_07_job_sensor_data(self): + """Test fetching bucketed sensor data for a job""" + print("\n[Test] get_job_sensor_bucketed_data") + if not self.job_id_to_test: self.skipTest("No job ID available") + + # Use a date range likely to cover "now" or recent past for testing + today = datetime.datetime.now().strftime("%Y-%m-%d") + + payload = { + "function": "get_job_sensor_bucketed_data", + "job_id": self.job_id_to_test, + "sensor": "temperature", + "date": today, + "bucket_size": "1h" + } + + data = self._post_api(payload) + + self.assertEqual(data.get('ok'), 1, f"Sensor data fetch failed: {data.get('error')}") + self.assertIn('chart_data', data) + self.assertIn('units', data) + self.assertIn('time_zone', data) + + # Since we created the job with a virtual MAC in test_01, + # we expect chart_data to contain an entry for that device (even if data list is empty) + # Note: The virtual MAC likely won't exist in the 'devices' table unless pre-seeded, + # so the API might skip it or return empty. We check structure primarily. + if data['chart_data']: + print(f"-> Retrieved data for {len(data['chart_data'])} locations") + first_loc = data['chart_data'][0] + self.assertIn('name', first_loc) + self.assertIn('data', first_loc) + else: + print("-> No device data found (Expected if test MAC is not in DB)") + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/test_welldrysense_api.sh b/test_welldrysense_api.sh new file mode 100644 index 0000000..a3c9be6 --- /dev/null +++ b/test_welldrysense_api.sh @@ -0,0 +1,305 @@ +#!/bin/bash + +# ============================================================================== +# WellDrySense API Test Suite (Bash Version) +# Functionality: Exercises Job APIs including Create, List, Edit, Details, Weather, +# Sensor Data, and performs Database Cleanup. +# ============================================================================== + +# --- Configuration --- +# Load .env file if it exists +if [ -f .env ]; then + export $(cat .env | xargs) +fi + +# Defaults (can be overridden by env vars) +PORT="${PORT:-8002}" +BASE_URL="http://localhost:$PORT/api/well_api" +API_USER="${API_USER:-jpeters}" +API_PASSWORD="${API_PASSWORD:-WellJson}" +DB_NAME="${DB_NAME:-wellnuo}" +DB_USER="${DB_USER:-postgres}" +DB_HOST="${DB_HOST:-localhost}" +DB_PORT="${DB_PORT:-5432}" +# DB_PASSWORD should be set in .env or exported + +# Colors +GREEN='\033[0;32m' +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Global Variables +TOKEN="" +USER_ID="" +JOB_ID="" + +# Check for jq +if ! command -v jq &> /dev/null; then + echo -e "${RED}Error: 'jq' is not installed. Please install it to run this script.${NC}" + exit 1 +fi + +echo -e "${BLUE}=== Setting up WellDrySense Test Suite on Port $PORT ===${NC}" + +# ============================================================================== +# Helper Functions +# ============================================================================== + +# Function to print section headers +print_header() { + echo -e "\n${BLUE}----------------------------------------------------------------${NC}" + echo -e "${BLUE}[Test] $1${NC}" +} + +# Function to perform a POST request +# Usage: perform_test "Test Name" "JSON_PAYLOAD_STRING" +perform_test() { + local test_name="$1" + local json_payload="$2" + + print_header "$test_name" + + # 1. Print Request + echo "# Request:" + echo "$json_payload" | jq '.' + + # 2. Convert JSON to Form Data for curl (flattening simple objects) + # Note: This simple conversion handles top-level keys. + # Complex nested JSON strings (like 'devices') need to be passed as strings in the input JSON. + local form_data="" + + # Extract keys and values and build form string + while IFS="=" read -r key value; do + if [ -n "$key" ]; then + # URL encode the value + encoded_value=$(printf '%s' "$value" | jq -sRr @uri) + if [ -z "$form_data" ]; then + form_data="${key}=${encoded_value}" + else + form_data="${form_data}&${key}=${encoded_value}" + fi + fi + done < <(echo "$json_payload" | jq -r "to_entries|map(\"\(.key)=\(.value)\")|.[]") + + # 3. Execute Request + response=$(curl -s -X POST "$BASE_URL" \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "$form_data") + + # 4. Print Response + echo -e "\n# Response:" + if [ -z "$response" ]; then + echo "(Empty Response)" + echo -e "${RED}FAIL${NC}" + return 1 + else + echo "$response" | jq '.' 2>/dev/null || echo "$response" + fi + + # 5. Evaluate Pass/Fail based on "ok": 1 + ok_val=$(echo "$response" | jq -r '.ok // .status // 0') + + # Handle different response structures (some return {status: 200}, some {ok: 1}) + if [ "$ok_val" == "1" ] || [ "$ok_val" == "200" ] || [ "$ok_val" == "success" ]; then + echo -e "${GREEN}PASS${NC}" + + # Extract Job ID if this was the create step + if [ "$test_name" == "job_create" ]; then + JOB_ID=$(echo "$response" | jq -r '.job_id') + echo "-> Captured Job ID: $JOB_ID" + fi + return 0 + else + error_msg=$(echo "$response" | jq -r '.error // .message // "Unknown error"') + echo -e "${RED}FAIL: $error_msg${NC}" + return 1 + fi +} + +# ============================================================================== +# Test Execution +# ============================================================================== + +# 1. Login / Credentials +# ---------------------- +login_payload=$(jq -n \ + --arg fn "credentials" \ + --arg un "$API_USER" \ + --arg ps "$API_PASSWORD" \ + --arg cid "bash-suite" \ + --arg nonce "test-nonce" \ + '{function: $fn, user_name: $un, ps: $ps, clientId: $cid, nonce: $nonce}') + +print_header "Login" +echo "# Request:" +echo "$login_payload" | jq '.' + +# Special handling for login to capture token +response=$(curl -s -X POST "$BASE_URL" -d "function=credentials&user_name=$API_USER&ps=$API_PASSWORD&clientId=bash-suite&nonce=test-nonce") + +echo -e "\n# Response:" +echo "$response" | jq '.' + +TOKEN=$(echo "$response" | jq -r '.access_token // .data.access_token') +USER_ID=$(echo "$response" | jq -r '.user_id // .data.user_id') + +if [ -n "$TOKEN" ] && [ "$TOKEN" != "null" ]; then + echo -e "${GREEN}PASS${NC} (User ID: $USER_ID)" +else + echo -e "${RED}FATAL: Login failed. Check credentials.${NC}" + exit 1 +fi + +# 2. Create Job +# ---------------------- +# Note: We pass JSON strings for complex fields like 'devices' and 'alerts_config' +devices_json='[{"mac": "TEST_MAC_VIRTUAL", "location": "Lab"}]' +alerts_json='{"temp_high": 30}' + +create_payload=$(jq -n \ + --arg fn "job_create" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg cn "TEST_SUITE_CUSTOMER_BASH" \ + --arg as "123 Bash Script Ln" \ + --arg ac "Shellville" \ + --arg dev "$devices_json" \ + --arg lat "34.05" \ + --arg lng "-118.25" \ + '{function: $fn, user_name: $un, token: $tk, customer_name: $cn, address_street: $as, address_city: $ac, devices: $dev, lat: $lat, lng: $lng}') + +perform_test "job_create" "$create_payload" || exit 1 + +# 3. Job List +# ---------------------- +list_payload=$(jq -n \ + --arg fn "job_list" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, user_name: $un, token: $tk}') + +perform_test "job_list" "$list_payload" + +# 3. Job List 2 (with added search) +# ---------------------- +list_payload=$(jq -n \ + --arg fn "job_list2" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg sch "" \ + '{function: $fn, user_name: $un, token: $tk, search: $sch}') + +perform_test "job_list2" "$list_payload" + +# 4. Job Details +# ---------------------- +details_payload=$(jq -n \ + --arg fn "job_details" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg jid "$JOB_ID" \ + '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +perform_test "job_details" "$details_payload" + +# 5. Job Edit (Stop Job) +# ---------------------- +edit_payload=$(jq -n \ + --arg fn "job_edit" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg jid "$JOB_ID" \ + --arg st "Stopped" \ + --arg dt "2025-12-31T23:59:59" \ + '{function: $fn, user_name: $un, token: $tk, job_id: $jid, job_status: $st, date_to: $dt}') + +perform_test "job_edit" "$edit_payload" + +# 6. Available Devices (two versions, with direct SQL and via GetProximityList) +# ---------------------- +avail_payload=$(jq -n \ + --arg fn "job_available_devices" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, user_name: $un, token: $tk}') + +perform_test "job_available_devices" "$avail_payload" + +# 6. Available Devices (Alternative Test using job_available_devices2, which is using GetProximityList) +avail_payload=$(jq -n \ + --arg fn "job_available_devices2" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + '{function: $fn, user_name: $un, token: $tk}') + +perform_test "job_available_devices2" "$avail_payload" + +# 6. Available Devices(made reusing job_user_all_devices2, adding filter and search) +avail_payload=$(jq -n \ + --arg fn "job_devices" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg fl "all" \ + --arg sch "" \ + '{function: $fn, user_name: $un, token: $tk, filter: $fl, search: $sch}') + +perform_test "job_devices" "$avail_payload" + +# 7. Job Weather +# ---------------------- +weather_payload=$(jq -n \ + --arg fn "job_weather" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg jid "$JOB_ID" \ + '{function: $fn, user_name: $un, token: $tk, job_id: $jid}') + +perform_test "job_weather" "$weather_payload" + +# 8. Job Sensor Bucketed Data (New Test) +# ---------------------- +# Using dynamic dates for the test +DATE_FROM=$(date +%Y-%m-%d) +DATE_TO=$(date +%Y-%m-%d) + +sensor_payload=$(jq -n \ + --arg fn "get_job_sensor_bucketed_data" \ + --arg un "$API_USER" \ + --arg tk "$TOKEN" \ + --arg jid "$JOB_ID" \ + --arg sens "temperature" \ + --arg dt "$DATE_FROM" \ + --arg dtt "$DATE_TO" \ + --arg bs "15m" \ + '{function: $fn, user_name: $un, token: $tk, job_id: $jid, sensor: $sens, date: $dt, to_date: $dtt, bucket_size: $bs}') + +perform_test "get_job_sensor_bucketed_data" "$sensor_payload" + +# ============================================================================== +# Cleanup +# ============================================================================== +print_header "Cleanup" + +if [ -n "$JOB_ID" ]; then + echo "-> Deleting Job ID: $JOB_ID from database..." + + # Use PGPASSWORD for non-interactive auth if set + export PGPASSWORD="${DB_PASSWORD}" + + psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" -c "DELETE FROM public.jobs WHERE job_id = $JOB_ID;" > /dev/null 2>&1 + + if [ $? -eq 0 ]; then + echo -e "${GREEN}Cleanup successful. Database restored.${NC}" + else + echo -e "${RED}Cleanup failed. Please manually delete job_id $JOB_ID from public.jobs.${NC}" + echo "Command attempted: psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c \"DELETE FROM public.jobs WHERE job_id = $JOB_ID;\"" + fi +else + echo "No Job ID created, skipping cleanup." +fi + +echo -e "\n${BLUE}=== Test Suite Finished ===${NC}" +# ============================================================================== +# well-api.py modifications to support WellDrySense API on port 1998 +# ============================================================================== \ No newline at end of file diff --git a/well-api.py b/well-api.py index c35fa16..34cc602 100644 --- a/well-api.py +++ b/well-api.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 #Version 2.0.2 9/25/2025 + import os import sys import ast @@ -377,7 +378,7 @@ def read_file(file_name, source = "LOCAL", type_ = "TEXT", bucket_name="daily-ma login_file = login_file.replace("\\","/") logger.debug(f"Full file path: {login_file}") logger.debug(f"File exists: {os.path.exists(login_file)}") - #print(login_file) + #logger.debug(login_file) if type_ == "TEXT": with open(login_file, encoding="utf8") as f: blob_data = f.read() @@ -1130,7 +1131,7 @@ def FillFields(blob_data, record, form_type): def StoreThresholds2DB(device_id, TR, BR, TLIFE, BLIFE): - #print('\nCreating create_caretaker\n') + #logger.debug('\nCreating create_caretaker\n') # Create a caretaker object. This object has nested properties and various types including numbers, DateTimes and strings. # This can be saved as JSON as is without converting into rows/columns. conn = get_db_connection() @@ -1151,7 +1152,7 @@ def StoreThresholds2DB(device_id, TR, BR, TLIFE, BLIFE): logger.debug(f"sql= {sql}") # Execute update query - print(sql) + logger.debug(sql) cur.execute(sql) # Commit the changes to the database @@ -1169,7 +1170,7 @@ def StoreThresholds2DB(device_id, TR, BR, TLIFE, BLIFE): #def StoreBeneficiary2DB(parameters, editing_user_id, user_id): - ##print('\nCreating create_caretaker\n') + ##logger.debug('\nCreating create_caretaker\n') ## Create a caretaker object. This object has nested properties and various types including numbers, DateTimes and strings. ## This can be saved as JSON as is without converting into rows/columns. @@ -1851,7 +1852,7 @@ def StoreFlow2DB(user_name, time_s, flow_json): return True except Exception as e: conn.rollback() - print(f"Error storing flow: {e}") + logger.debug(f"Error storing flow: {e}") logger.debug(f"Error storing flow: {e}") return False finally: @@ -1875,7 +1876,7 @@ def PersonInDB(f_l_name): cur.execute(sql) user_id = cur.fetchone()[0] except Exception as err: - print(str(err)) + logger.debug(str(err)) return user_id def GetDepoymentId(beneficiary_id): @@ -1892,7 +1893,7 @@ def GetDepoymentId(beneficiary_id): deployments_id = cur.fetchall() result = [item[0] for item in deployments_id] except Exception as err: - print(str(err)) + logger.debug(str(err)) return result @@ -2136,7 +2137,7 @@ def StoreDevice2DB(parameters, editing_device_id): logger.debug(f"[{call_id}] StoreDevice2DB ENTRY - editing_device_id: {editing_device_id}") logger.debug(f"[{call_id}] Parameters: {parameters}") - print(f"[{call_id}] StoreDevice2DB ENTRY - editing_device_id: {editing_device_id}") + logger.debug(f"[{call_id}] StoreDevice2DB ENTRY - editing_device_id: {editing_device_id}") # Database connection conn = get_db_connection() @@ -2211,11 +2212,11 @@ def StoreDevice2DB(parameters, editing_device_id): logger.debug(f"[{call_id}] Using UPSERT with composite key (well_id, device_mac)") logger.debug(f"[{call_id}] SQL: {sql}") - print(f"[{call_id}] SQL: {sql}") + logger.debug(f"[{call_id}] SQL: {sql}") logger.debug(f"[{call_id}] SQL: {sql}") - print(f"[{call_id}] SQL: {sql}") + logger.debug(f"[{call_id}] SQL: {sql}") # === ADD THIS NEW DEBUGGING BLOCK === final_well_id = CleanObject(parameters.get('well_id')) @@ -2235,7 +2236,7 @@ def StoreDevice2DB(parameters, editing_device_id): conn.close() logger.debug(f"[{call_id}] StoreDevice2DB SUCCESS - returning 1") - print(f"[{call_id}] StoreDevice2DB SUCCESS - returning 1") + logger.debug(f"[{call_id}] StoreDevice2DB SUCCESS - returning 1") AddToLog("Written/updated!") return 1 @@ -2251,7 +2252,7 @@ def StoreDevice2DB(parameters, editing_device_id): except: pass logger.debug(f"[{call_id}] StoreDevice2DB ERROR - returning 0") - print(f"[{call_id}] StoreDevice2DB ERROR - returning 0") + logger.debug(f"[{call_id}] StoreDevice2DB ERROR - returning 0") return 0 def StoreGroupToDevice(editing_device_id_or_mac, group_id, user_name): @@ -2301,7 +2302,7 @@ def StoreGroupToDevice(editing_device_id_or_mac, group_id, user_name): break try: record = json.loads(item_json) - print(record) + logger.debug(record) break except: pass @@ -2395,7 +2396,7 @@ def StoreWellIdToDevice(editing_device_id_or_mac, well_id, user_name): break try: record = json.loads(item_json) - print(record) + logger.debug(record) break except: pass @@ -2486,7 +2487,7 @@ def GetDeviceLive(editing_device_id_or_mac, user_name): break try: record = json.loads(item_json) - print(record) + logger.debug(record) break except: pass @@ -2545,7 +2546,7 @@ def StoreNetworkIdToDevice(editing_device_id_or_mac, network_id, user_name): break try: record = json.loads(item_json) - print(record) + logger.debug(record) break except: pass @@ -2603,7 +2604,7 @@ def DeviceReboot(editing_device_id_or_mac, user_name): break try: record = json.loads(item_json) - print(record) + logger.debug(record) break except: pass @@ -2660,7 +2661,7 @@ def UpdateDevicesTable(html_string, devices, users): mac = device[2] if mac == "64B7088903B4": - print("stop") + logger.debug("stop") mac_row_string = f'