--
INSERT INTO {auth_user} (method, username, name, email, password) VALUES('manual', 'admin', 'Administrador',  'admin@admin.com', '21232f297a57a5a743894a0e4a801fc3');
INSERT INTO {auth_user} (method, username, name, email, password) VALUES('manual', 'maria', 'Maria da Silva', 'maria@admin.com', '263bce650e68ab4e23f28263760b9fa5');
INSERT INTO {auth_user} (method, username, name, email, password) VALUES('manual', 'joao', 'João dos Santos', 'joao@vendas.com', 'dccd96c256bc7dd39bae41a405f25e43');

INSERT INTO {auth_group} (name) VALUES('admin');
INSERT INTO {auth_group} (name) VALUES('administrative');
INSERT INTO {auth_group} (name) VALUES('sales');

INSERT INTO {auth_permission} (name) VALUES('sys:admin');
INSERT INTO {auth_permission} (name) VALUES('sys:login');
INSERT INTO {auth_permission} (name) VALUES('user:view');--
INSERT INTO {auth_permission} (name) VALUES('user:create');
INSERT INTO {auth_permission} (name) VALUES('user:edit');
INSERT INTO {auth_permission} (name) VALUES('user:purge');
INSERT INTO {auth_permission} (name) VALUES('product:view');--
INSERT INTO {auth_permission} (name) VALUES('product:create');
INSERT INTO {auth_permission} (name) VALUES('product:edit');
INSERT INTO {auth_permission} (name) VALUES('product:purge');
INSERT INTO {auth_permission} (name) VALUES('client:view');--
INSERT INTO {auth_permission} (name) VALUES('client:create');
INSERT INTO {auth_permission} (name) VALUES('client:edit');
INSERT INTO {auth_permission} (name) VALUES('client:purge');
INSERT INTO {auth_permission} (name) VALUES('sales:view');--
INSERT INTO {auth_permission} (name) VALUES('sales:viewself');
INSERT INTO {auth_permission} (name) VALUES('sales:create');
INSERT INTO {auth_permission} (name) VALUES('sales:edit');
INSERT INTO {auth_permission} (name) VALUES('sales:purge');
INSERT INTO {auth_permission} (name) VALUES('sales:faturate');

INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'admin'), (SELECT id FROM {auth_permission} WHERE name = 'user:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'admin'), (SELECT id FROM {auth_permission} WHERE name = 'user:create'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'admin'), (SELECT id FROM {auth_permission} WHERE name = 'user:edit'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'admin'), (SELECT id FROM {auth_permission} WHERE name = 'user:purge'));

INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'product:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'product:create'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'product:edit'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'product:purge'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'client:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'client:create'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'client:edit'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'client:purge'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'sales:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'administrative'), (SELECT id FROM {auth_permission} WHERE name = 'sales:faturate'));

INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'product:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'client:view'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'client:create'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'client:edit'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'sales:viewself'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'sales:create'));
INSERT INTO {auth_permission_group} (group_id, permission_id) VALUES((SELECT id FROM {auth_group} WHERE name = 'sales'), (SELECT id FROM {auth_permission} WHERE name = 'sales:edit'));

INSERT INTO {auth_group_user} (user_id, group_id) VALUES((SELECT id FROM {auth_user} WHERE username = 'maria'), (SELECT id FROM {auth_group} WHERE name = 'admin'));
INSERT INTO {auth_group_user} (user_id, group_id) VALUES((SELECT id FROM {auth_user} WHERE username = 'maria'), (SELECT id FROM {auth_group} WHERE name = 'administrative'));
INSERT INTO {auth_group_user} (user_id, group_id) VALUES((SELECT id FROM {auth_user} WHERE username = 'joao'),  (SELECT id FROM {auth_group} WHERE name = 'sales'));

INSERT INTO {auth_permission_user} (user_id, permission_id, action) VALUES((SELECT id FROM {auth_user} WHERE username = 'admin'),  (SELECT id FROM {auth_permission} WHERE name = 'sys:admin'), 'a');
INSERT INTO {auth_permission_user} (user_id, permission_id, action) VALUES((SELECT id FROM {auth_user} WHERE username = 'maria'),  (SELECT id FROM {auth_permission} WHERE name = 'sys:login'), 'a');
INSERT INTO {auth_permission_user} (user_id, permission_id, action) VALUES((SELECT id FROM {auth_user} WHERE username = 'joao'),  (SELECT id FROM {auth_permission} WHERE name = 'sys:login'), 'a');
