Skip to content

Instantly share code, notes, and snippets.

@tgmarinho
Last active August 11, 2023 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgmarinho/7f46976b70aa40360ce575c90cde7113 to your computer and use it in GitHub Desktop.
Save tgmarinho/7f46976b70aa40360ce575c90cde7113 to your computer and use it in GitHub Desktop.
-- SHIFT 1
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-01 14:00:00-04', '2023-08-01 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-01 14:30:00-04', '2023-08-01 14:00:00-04', '2023-08-01 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-07-31 12:00:00-04', '2023-07-31 12:00:00-04', '2023-07-31 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 2
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-02 14:00:00-04', '2023-08-02 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-02 14:45:00-04', '2023-08-02 14:00:00-04', '2023-08-02 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-01 12:00:00-04', '2023-08-01 12:00:00-04', '2023-08-01 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 3
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-03 14:00:00-04', '2023-08-03 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-03 15:00:00-04', '2023-08-03 14:00:00-04', '2023-08-03 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-02 12:00:00-04', '2023-08-02 12:00:00-04', '2023-08-02 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 4
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-04 14:00:00-04', '2023-08-04 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-04 15:15:00-04', '2023-08-04 14:00:00-04', '2023-08-04 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-03 12:00:00-04', '2023-08-03 12:00:00-04', '2023-08-03 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 5
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-05 14:00:00-04', '2023-08-05 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-05 15:30:00-04', '2023-08-05 14:00:00-04', '2023-08-05 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-04 12:00:00-04', '2023-08-04 12:00:00-04', '2023-08-04 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 6
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-06 14:00:00-04', '2023-08-06 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-06 16:00:00-04', '2023-08-06 14:00:00-04', '2023-08-06 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-05 12:00:00-04', '2023-08-05 12:00:00-04', '2023-08-05 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 7
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-07 14:00:00-04', '2023-08-07 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-07 14:15:00-04', '2023-08-07 14:00:00-04', '2023-08-07 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-07 13:00:00-04', '2023-08-06 13:00:00-04', '2023-08-06 13:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 8
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-08 14:00:00-04', '2023-08-08 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-08 14:00:00-04', '2023-08-08 14:00:00-04', '2023-08-08 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-07 12:00:00-04', '2023-08-07 12:00:00-04', '2023-08-07 12:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 9
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-09 14:00:00-04', '2023-08-09 22:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 6, '2023-08-09 14:00:00-04', '2023-08-09 14:00:00-04', '2023-08-09 22:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, created_at, updated_at)
SELECT id, 1647, 2, 12.42, '2023-08-09 04:00:00-04', '2023-08-08 04:00:00-04', '2023-08-09 04:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
-- SHIFT 10 - CANCELED
-- Inserir o turno (shift)
INSERT INTO shifts (facility_id, certification_id, recurring_type_id, start_date, end_date, is_active, shift_timecode_id, shift_incentive_hourly, shift_bonus, shift_assignment_type, created_by, first_occurrence_starts, first_occurrence_ends, created_at, updated_at, deleted_at, shift_type, state_id)
VALUES
(213, 3, 1, '2023-08-09 08:00:00-04', '2023-08-09 16:00:00-04', true, 6, NULL, 0.0, 1, 1612, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04','2023-07-30 06:00:00-04', NULL, 1, 51)
RETURNING id;
-- Inserir a instância de turno (shift_instance)
INSERT INTO shift_instances (shift_id, user_id, status, clock_in, start_date_time, end_date_time, pay_rate, bonus, created_at, updated_at)
SELECT id, 1647, 3, NULL, '2023-08-09 08:00:00-04', '2023-08-09 16:00:00-04', 12.0, 0, '2023-07-30 06:00:00-04', '2023-07-30 06:00:00-04'
FROM shifts
ORDER BY id DESC
LIMIT 1;
-- Inserir o lance para a instância de turno (shift_bid)
INSERT INTO shift_bids (shift_instance_id, user_id, status, bid_amount, confirmed_at, canceled_at, created_at, updated_at, deleted_at)
SELECT id, 1647, 2, 12.42, '2023-08-07 13:00:00-04', '2023-08-09 02:00:00-04', '2023-08-07 13:00:00-04', '2023-08-07 13:00:00-04', '2023-08-09 02:00:00-04'
FROM shift_instances
ORDER BY id DESC
LIMIT 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment