-- Creates initial entries for a workspace and adds some collections and requests to it.
-- Creates an environment.

INSERT INTO workspaces(id, name) VALUES (0, 'My workspace');

INSERT INTO workspace_envs(id, workspace_id, name) VALUES (0, 0, 'My env');

INSERT INTO 
  workspace_env_variables(id, workspace_id, env_id, name, value, secret)
  VALUES(0, 0, 0, 'BASE_URL', 'https://jsonplaceholder.typicode.com', false);

INSERT INTO 
  workspace_entries(id, workspace_id, parent_id, name, type)
  VALUES (0, 0, NULL, 'My collection', 1);

INSERT INTO 
  workspace_entries(id, workspace_id, parent_id, name, type)
  VALUES 
    (1, 0, 0, 'My request in col', 0),
    (2, 0, NULL, 'My request', 0);

INSERT INTO 
  request_params(workspace_id, request_id, method, url)
  VALUES 
    (0, 1, 'GET', '{{BASE_URL}}/posts/:ID'),
    (0, 2, 'GET', '{{BASE_URL}}/todos/:ID');

INSERT INTO request_path_params(position, request_id, name, value)
  VALUES
    (18, 1, 'ID', '1'),
    (18, 2, 'ID', '1');

INSERT INTO request_headers(request_id, name, value) VALUES(1, 'accept', '*/*');
