/
h0tnanny
/
IotPlatform
Обзор
Документация
Войти
/
h0tnanny
/
IotPlatform
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
database/backup_before_auth_data.sql
40 строк
9 KB
h0tnanny
fix readonly permissions
01 фев 2026, 23:32
01 фев 2026, 23:32
01880f6
Код
Авторство
О чём код?
-- Backup of iot_platform database before auth migration -- Created at: 2026-02-01T20:10:38.059Z -- To restore: psql -h localhost -p 5433 -U postgres -d iot_platform -f backup_before_auth_data.sql BEGIN; INSERT INTO workflows (id, name, description, update_interval, is_activated, start_node_id, created_at, updated_at) VALUES ('wf-temperature-alert', 'Мониторинг температуры', 'Проверяет температуру и выводит предупреждение если > 30°C', 1000, true, 'node-check-temp', '2026-01-24T15:16:48.715Z', '2026-01-24T15:16:48.715Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflows (id, name, description, update_interval, is_activated, start_node_id, created_at, updated_at) VALUES ('wf-counter-loop', 'Счетчик с циклом', 'Увеличивает счетчик от 0 до 5', 2000, true, 'node-loop-start', '2026-01-24T15:16:48.722Z', '2026-01-24T15:16:48.722Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflows (id, name, description, update_interval, is_activated, start_node_id, created_at, updated_at) VALUES ('wf-inactive-test', 'Неактивный workflow', 'Этот workflow не должен выполняться', 1000, false, 'node-test-start', '2026-01-24T15:16:48.725Z', '2026-01-24T15:16:48.725Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-loop-start', 'wf-counter-loop', 'Цикл While', 'LoopNode', '{"operator":"<","fieldName":"counter","bodyNodeId":"node-increment","exitNodeId":"node-loop-end","compareValue":5,"maxIterations":10}', '2026-01-24T15:16:48.723Z', '2026-01-24T15:16:48.723Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-increment', 'wf-counter-loop', 'Увеличить счетчик', 'ActionNode', '{"code":"const c = context.variableList.get(\"counter\"); c.value = c.value + 1; console.log(\"Счетчик: \" + c.value);","nextNodeId":"node-loop-start"}', '2026-01-24T15:16:48.723Z', '2026-01-24T15:16:48.723Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-loop-end', 'wf-counter-loop', 'Завершение цикла', 'ActionNode', '{"code":"console.log(\"✓ Цикл завершен. Финальное значение: \" + context.variableList.get(\"counter\").value);","nextNodeId":null}', '2026-01-24T15:16:48.723Z', '2026-01-24T15:16:48.723Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-test-start', 'wf-inactive-test', 'Тестовый узел', 'ActionNode', '{"code":"console.log(\"Этот код не должен выполниться\");","nextNodeId":null}', '2026-01-24T15:16:48.726Z', '2026-01-24T15:16:48.726Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-check-temp', 'wf-temperature-alert', 'Проверка температуры', 'ConditionNode', '{"operator":">","fieldName":"temperature","trueNextId":"node-high-temp","falseNextId":"node-normal-temp","compareValue":30}', '2026-01-24T15:16:48.721Z', '2026-01-24T15:16:48.721Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-high-temp', 'wf-temperature-alert', 'Высокая температура', 'ActionNode', '{"code":"context.variableList.get(\"alertMessage\").value = \"⚠️ ВНИМАНИЕ: Температура \" + context.variableList.get(\"temperature\").value + \"°C превышает норму!\"; console.log(context.variableList.get(\"alertMessage\").value);","nextNodeId":null}', '2026-01-24T15:16:48.721Z', '2026-01-24T15:16:48.721Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_nodes (id, workflow_id, name, type, config, created_at, updated_at) VALUES ('node-normal-temp', 'wf-temperature-alert', 'Нормальная температура', 'ActionNode', '{"code":"context.variableList.get(\"alertMessage\").value = \"✓ Температура в норме: \" + context.variableList.get(\"temperature\").value + \"°C\"; console.log(context.variableList.get(\"alertMessage\").value);","nextNodeId":null}', '2026-01-24T15:16:48.721Z', '2026-01-24T15:16:48.721Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (10, 'wf-counter-loop', 'counter', 'Счетчик', 'Number', '0', '2026-01-24T15:16:48.722Z', '2026-01-24T15:16:48.722Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (11, 'wf-counter-loop', 'maxCount', 'Максимальное значение', 'Number', '5', '2026-01-24T15:16:48.722Z', '2026-01-24T15:16:48.722Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (12, 'wf-inactive-test', 'testVar', 'Тестовая переменная', 'String', '"inactive"', '2026-01-24T15:16:48.725Z', '2026-01-24T15:16:48.725Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (7, 'wf-temperature-alert', 'temperature', 'Текущая температура', 'Number', '25', '2026-01-24T15:16:48.719Z', '2026-01-24T15:16:48.719Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (8, 'wf-temperature-alert', 'threshold', 'Порог температуры', 'Number', '30', '2026-01-24T15:16:48.719Z', '2026-01-24T15:16:48.719Z') ON CONFLICT (id) DO NOTHING; INSERT INTO workflow_variables (id, workflow_id, name, description, type, value, created_at, updated_at) VALUES (9, 'wf-temperature-alert', 'alertMessage', 'Сообщение тревоги', 'String', '""', '2026-01-24T15:16:48.719Z', '2026-01-24T15:16:48.719Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment (id, name, protocol, data_mode, endpoint, poll_interval, created_at, updated_at) VALUES ('eq-temp-sensor', 'Датчик температуры #1', 'http', 'active', 'http://sensor.local/api/temperature', 5000, '2026-01-24T15:16:48.727Z', '2026-01-24T15:16:48.727Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment (id, name, protocol, data_mode, endpoint, poll_interval, created_at, updated_at) VALUES ('eq-pressure-sensor', 'Датчик давления', 'udp', 'active', '192.168.1.100:5000', 3000, '2026-01-24T15:16:48.729Z', '2026-01-24T15:16:48.729Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment (id, name, protocol, data_mode, endpoint, poll_interval, created_at, updated_at) VALUES ('eq-external-api', 'Внешний API источник', 'http', 'passive', '/datasource/eq-external-api', 0, '2026-01-24T15:16:48.731Z', '2026-01-24T15:16:48.731Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (19, 'eq-external-api', 'isConnected', 'Подключен', 'Boolean', 'false', '2026-01-24T15:16:48.731Z', '2026-01-24T15:16:48.731Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (17, 'eq-external-api', 'dataValue', 'Значение данных', 'Number', '0', '2026-01-24T15:16:48.731Z', '2026-01-24T15:16:48.731Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (18, 'eq-external-api', 'lastUpdate', 'Последнее обновление', 'String', '"never"', '2026-01-24T15:16:48.731Z', '2026-01-24T15:16:48.731Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (15, 'eq-pressure-sensor', 'altitude', 'Высота (м)', 'Number', '150', '2026-01-24T15:16:48.730Z', '2026-01-24T15:16:48.730Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (14, 'eq-pressure-sensor', 'pressure', 'Давление (кПа)', 'Number', '101', '2026-01-24T15:16:48.730Z', '2026-01-24T15:16:48.730Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (16, 'eq-pressure-sensor', 'isCalibrated', 'Откалиброван', 'Boolean', 'true', '2026-01-24T15:16:48.730Z', '2026-01-24T15:16:48.730Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (11, 'eq-temp-sensor', 'temperature', 'Температура', 'Double', '22.5', '2026-01-24T15:16:48.728Z', '2026-01-24T15:16:48.728Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (13, 'eq-temp-sensor', 'status', 'Статус датчика', 'String', '"online"', '2026-01-24T15:16:48.728Z', '2026-01-24T15:16:48.728Z') ON CONFLICT (id) DO NOTHING; INSERT INTO equipment_variables (id, equipment_id, name, description, type, value, created_at, updated_at) VALUES (12, 'eq-temp-sensor', 'humidity', 'Влажность', 'Double', '45.3', '2026-01-24T15:16:48.728Z', '2026-01-24T15:16:48.728Z') ON CONFLICT (id) DO NOTHING; COMMIT;