use hades_db;

SET FOREIGN_KEY_CHECKS = 0;
-- source /var/lib/mysql-files/truncate.sql;
-- Note: The truncate.sql file is not being generated anymore.
-- If you need to truncate tables, add explicit TRUNCATE statements here.
SET FOREIGN_KEY_CHECKS = 1;

ALTER TABLE agencies_id_generator AUTO_INCREMENT = 1000;
ALTER TABLE clients_id_generator AUTO_INCREMENT = 2000;
ALTER TABLE mccs_id_generator AUTO_INCREMENT = 3000;
ALTER TABLE users_v3 AUTO_INCREMENT = 10000;
ALTER TABLE auth_provider_metadata_v2 AUTO_INCREMENT = 20000;

INSERT IGNORE INTO status_types (name) VALUES ('ACTIVE');
INSERT IGNORE INTO status_types (name) VALUES ('INACTIVE');
INSERT IGNORE INTO status_types (name) VALUES ('BLOCKED');

INSERT IGNORE INTO organization_types (name) VALUES ('CLIENT');
INSERT IGNORE INTO organization_types (name) VALUES ('AGENCY');

INSERT IGNORE INTO access_roles (name) VALUES ('READ');
INSERT IGNORE INTO access_roles (name) VALUES ('READ_WRITE');
INSERT IGNORE INTO access_roles (name) VALUES ('ADMIN');

INSERT IGNORE INTO auth_provider_types (name) VALUES ('EMAIL');
INSERT IGNORE INTO auth_provider_types (name) VALUES ('MOBILE');

INSERT IGNORE INTO teams (id, name, status_type_id) VALUES
    (1, 'analytics', 1),
    (2, 'branding', 1),
    (4, 'core-reporting', 1),
    (5, 'growth-apps', 1),
    (6, 'heisenberg', 1),
    (7, 'hercules', 1),
    (8, 'infra', 1),
    (9,  'iris', 1),
    (10, 'iris-reporting', 1),
    (11, 'lcs-analytics', 1),
    (12, 'marketing', 1),
    (13, 'merchandise', 1),
    (14, 'platform', 1),
    (15, 'revx', 1),
    (16, 'scorpii', 1),
    (17, 'smb-dev', 1),
    (18, 'sokrati-dev', 1),
    (19, 'tafStore', 1),
    (20, 'tracking', 1),
    (21, 'unified-tracking', 1);

INSERT IGNORE INTO auth_channels (id, name) VALUES(1, 'SOKRATI');
INSERT IGNORE INTO auth_channels (id, name) VALUES(2, 'LINKEDIN');
INSERT IGNORE INTO auth_channels (id, name) VALUES(3, 'SHOPIFY');
INSERT IGNORE INTO auth_channels (id, name) VALUES(4, 'BIGCOMMERCE');
INSERT IGNORE INTO auth_channels (id, name) VALUES(5, 'FACEBOOK');
INSERT IGNORE INTO auth_channels (id, name) VALUES(6, 'GOOGLE');

INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'firstName');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'lastName');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'headline');
INSERT IGNORE INTO auth_channel_keys (auth_channel_id, `key`) VALUES (2, 'pictureUrl');

INSERT IGNORE INTO entity_types(id, name) VALUES (1, 'CLIENT'), (2, 'AGENCY'), (3, 'MCC');

INSERT IGNORE INTO access_permissions(id, name) VALUES (1, 'OPEN_END_POINT'), (2, 'ACL_FREE'), (3, 'ACL_APP'), (4, 'ACL_TOKEN_CHECK'), (5, 'ACL_READ'), (6, 'ACL_WRITE'), (7, 'ACL_ADMIN');

INSERT IGNORE INTO access_role_permission_mappings(access_role_id, permission_id) VALUES (1, 5), (2, 5), (2, 6), (3, 5), (3, 6), (3, 7);

INSERT IGNORE INTO apps (id, name, token) VALUES (1, 'HADES', '9d4a2fc3024a600f96c1b7c589ea164b');

INSERT IGNORE INTO app_ips_accesses (app_id, ipaddress) VALUES (1, '127.0.0.1');
