INSERT INTO role (name)
SELECT 'ROLE_ADMIN'
WHERE NOT EXISTS(SELECT * FROM role WHERE role.name = 'ROLE_ADMIN');

INSERT INTO role (name)
SELECT 'ROLE_USER'
WHERE NOT EXISTS(SELECT * FROM role WHERE role.name = 'ROLE_USER');

INSERT INTO users (password, email)
SELECT '$2a$10$JChJcsJNVtqXPi88MPNRuuBhyAUEfUt12n2Cf1weK8gvAAXfPzzZ2', 'prof.kowalski@example.com'
WHERE NOT EXISTS(SELECT * FROM users WHERE users.email = 'prof.kowalski@example.com');

INSERT INTO users_roles (user_id, roles_id)
SELECT 1, 1
WHERE NOT EXISTS(SELECT * FROM users_roles WHERE user_id=1 AND roles_id=1);

INSERT INTO users_roles (user_id, roles_id)
SELECT 1, 2
WHERE NOT EXISTS(SELECT * FROM users_roles WHERE user_id=1 AND roles_id=2);
