INSERT INTO Genre (Name) VALUES
('Action'), ('Adventure'), ('Animation'), ('Biography'), ('Comedy'),
('Crime'), ('Documentary'), ('Drama'), ('Family'), ('Fantasy'),
('Film-Noir'), ('History'), ('Horror'), ('Music'), ('Musical'),
('Mystery'), ('Romance'), ('Sci-Fi'), ('Sport'), ('Thriller'),
('War'), ('Western'), ('Psychological'), ('Supernatural'),
('Cyberpunk'), ('Post-Apocalyptic'), ('Martial Arts'), ('Slasher'),
('Mockumentary')
ON CONFLICT (Name) DO NOTHING;

-- LANGUAGE
INSERT INTO Language (Name) VALUES
('Macedonian'), ('English'), ('Albanian'), ('Spanish'), ('French'),
('German'), ('Italian'), ('Portuguese'), ('Russian'), ('Japanese'),
('Korean'), ('Chinese (Mandarin)'), ('Turkish'), ('Serbian'),
('Croatian'), ('Bulgarian'), ('Greek'), ('Arabic'), ('Hindi'),
('Dutch'), ('Polish'), ('Romanian'), ('Swedish'), ('Norwegian'),
('Finnish'), ('Ukrainian'), ('Hebrew'), ('Persian'), ('Thai'),
('Vietnamese'), ('Indonesian'), ('Malay'), ('Bengali'), ('Urdu')
ON CONFLICT (Name) DO NOTHING;

-- SUBSCRIPTION
INSERT INTO Subscription (Name, Price, MaxDevices, VideoQuality) VALUES
('Basic Plan',    4.99,  1, '720p (HD)'),
('Standard Plan', 8.99,  2, '1080p (Full HD)'),
('Premium Plan',  13.99, 4, '4K + HDR'),
('Family Ultra',  19.99, 6, '4K + HDR + Atmos'),
('Student Deal',  2.99,  1, '1080p (Full HD)'),
('Mobile Only',   3.50,  1, '480p (SD)')
ON CONFLICT DO NOTHING;

--names

CREATE TEMP TABLE temp_names (name VARCHAR(255));
INSERT INTO temp_names
SELECT name FROM (VALUES
('Aleksandar'),('Filip'),('Nikola'),('Stefan'),('Martin'),
('Viktor'),('Dimitar'),('Marko'),('Petar'),('Ivan'),
('Bojan'),('Darko'),('Goran'),('Hristijan'),('Igor'),
('Jovan'),('Kosta'),('Lazar'),('Mile'),('Nace'),
('Ognen'),('Pavel'),('Risto'),('Saso'),('Tome'),
('Blagoj'),('Cvetan'),('Dragan'),('Emilijan'),('Frosino'),
('Metodija'),('Trajche'),('Vasko'),('Zoran'),('Aco'),
('Branko'),('Cvetko'),('Dushko'),('Gjorgi'),('Ilija'),
('Ana'),('Sara'),('Elena'),('Maja'),('Ivana'),
('Kristina'),('Monika'),('Jana'),('Sofija'),('Milica'),
('Valentina'),('Zaneta'),('Angela'),('Biljana'),('Cvetanka'),
('Daniela'),('Emilija'),('Frosina'),('Gordana'),('Hristina'),
('Irena'),('Jasmina'),('Katerina'),('Lidija'),('Magdalena'),
('Natasha'),('Olivera'),('Patricia'),('Renata'),('Silvana'),
('Tatjana'),('Ubavka'),('Vesna'),('Zorica'),('Andrijana'),
('Snezana'),('Radmila'),('Slavica'),('Dragica'),('Ljupka'),
('Slavko'),('Radovan'),('Dragan'),('Miroslav'),('Branimir'),
('Slobodan'),('Dejan'),('Nenad'),('Predrag'),('Zeljko'),
('Aleksandrina'),('Viktorija'),('Nikolina'),('Stefanija'),('Martina'),
-- od CSV na damle
('Dimitar'),('Ljupcho'),('Toni'),('Dushica'),('Sonja'),
('Violeta'),('Rozeta'),('Sunita'),('Rumena'),('Verica'),
('Zlatko'),('Sinisha'),('Zivko'),('Mirko'),('Stojko'),
('Kire'),('Pece'),('Vanco'),('Done'),('Slave'),
('Spase'),('Trpe'),('Riste'),('Naum'),('Pande'),
('Mende'),('Blagica'),('Cana'),('Dafina'),('Evica'),
('Zagorka'),('Ivanka'),('Kalinka'),('Lepa'),('Marta'),
('Nada'),('Olga'),('Pana'),('Rada'),('Stana'),
('Tinka'),('Velika'),('Zlata'),('Angelina'),('Bisera'),
('Cveta'),('Desa'),('Efimija'),('Grozdana'),('Hrista'),
('Iskra'),('Jasna'),('Ksenija'),('Lena'),('Mila'),
('Nina'),('Olgica'),('Petra'),('Rosa'),('Sneza'),
('Tanja'),('Vera'),('Zora'),('Agim'),('Besnik'),
('Driton'),('Erjon'),('Fisnik'),('Gentian'),('Hekuran'),
('Ilir'),('Jetmir'),('Kujtim'),('Liridon'),('Mentor'),
('Naser'),('Omer'),('Petrit'),('Qendrim'),('Rinor'),
('Sokol'),('Taulant'),('Urim'),('Valbon'),('Xhevat'),
('Yllka'),('Zejnep'),('Aferdita'),('Blerina'),('Donika'),
('Elona'),('Fjolla'),('Ganimete'),('Hydajet'),('Iliriana'),
('Jehona'),('Kaltrina'),('Lindita'),('Mimoza'),('Njomza'),
('Pranvera'),('Rina'),('Shqipe'),('Teuta'),('Valdete')
) AS t(name);



--preziminja:
CREATE TEMP TABLE temp_surnames (surname VARCHAR(255));
INSERT INTO temp_surnames
SELECT surname FROM (VALUES

('Stojanovski'),('Petrov'),('Nikolovski'),('Angelovski'),('Blazevski'),
('Cvetkovski'),('Dimovski'),('Filipovski'),('Georgievski'),('Hristovski'),
('Ilievski'),('Jovanovski'),('Kitanovski'),('Lazarevski'),('Markovski'),
('Nacevski'),('Pavlovski'),('Ristovski'),('Stefanovski'),('Trajkovski'),
('Veljanovski'),('Zdravevski'),('Atanasov'),('Bogdanovski'),('Damjanovski'),
('Efremovski'),('Fotevski'),('Grozdanovski'),('Ivanovski'),('Janevski'),
('Kostadinovski'),('Lozanovski'),('Mitrevski'),('Naumovski'),('Popovski'),
('Ristevski'),('Simovski'),('Todorovski'),('Velkovski'),('Zafirovski'),
('Acevski'),('Bozinovski'),('Dukovski'),('Elenovski'),('Gligorovski'),
('Krstevski'),('Marinkovski'),('Borcevski'),('Stojchevski'),('Velickovski'),
('Apostolovski'),('Blagoevski'),('Carevski'),('Dejanovski'),('Enchevski'),
('Gorgievski'),('Ilkoski'),('Jovchevski'),('Kocevski'),('Lazevski'),
('Minovski'),('Nestorovski'),('Petrovski'),('Sazdovski'),('Tasevski'),
('Temelkovski'),('Serafimovski'),('Radovanovski'),('Manchevski'),('Josifovski'),
('Filipchevski'),('Evtimovski'),('Davidovski'),('Bunevski'),('Denkovski'),
('Smith'),('Johnson'),('Williams'),('Brown'),('Jones'),
('Garcia'),('Miller'),('Davis'),('Wilson'),('Anderson'),
('Taylor'),('Thomas'),('Jackson'),('White'),('Harris'),
('Martin'),('Thompson'),('Young'),('Allen'),('King'),
('Wright'),('Scott'),('Torres'),('Hill'),('Adams'),
('Mitchell'),('Carter'),('Roberts'),('Turner'),('Phillips'),
('Campbell'),('Parker'),('Evans'),('Edwards'),('Collins'),
('Stewart'),('Morris'),('Rogers'),('Reed'),('Cook'),
('Morgan'),('Bell'),('Murphy'),('Bailey'),('Rivera'),
('Cooper'),('Richardson'),('Cox'),('Howard'),('Ward'),
('Muller'),('Schmidt'),('Schneider'),('Fischer'),('Weber'),
('Meyer'),('Wagner'),('Becker'),('Hoffmann'),('Schulz'),
('Martin'),('Bernard'),('Dubois'),('Thomas'),('Robert'),
('Rossi'),('Ferrari'),('Esposito'),('Romano'),('Colombo'),
('Garcia'),('Martinez'),('Lopez'),('Sanchez'),('Gonzalez'),
('Silva'),('Santos'),('Oliveira'),('Pereira'),('Costa'),
('Kowalski'),('Wojcik'),('Kowalczyk'),('Kaminski'),('Nowak'),
('Popescu'),('Ionescu'),('Popa'),('Constantin'),('Gheorghe'),
('Ivanov'),('Georgiev'),('Dimitrov'),('Todorov'),('Hristov'),
('Kovac'),('Horvat'),('Babic'),('Marko'),('Novak'),
('Kim'),('Lee'),('Park'),('Choi'),('Jung'),
('Yamamoto'),('Tanaka'),('Watanabe'),('Suzuki'),('Sato'),
('Wang'),('Li'),('Zhang'),('Liu'),('Chen'),
('Nguyen'),('Tran'),('Pham'),('Vu'),('Hoang'),
('Hernandez'),('Ramirez'),('Flores'),('Reyes'),('Cruz'),
('Morales'),('Ortiz'),('Gutierrez'),('Chavez'),('Romero'),
('Petrov'),('Sokolov'),('Volkov'),('Lebedev'),('Kozlov'),
('Novikov'),('Morozov'),('Popov'),('Sokolov'),('Mikhailov')
) AS t(surname);

--generiranje users

INSERT INTO "User" (FirstName, LastName, Username, Email, password, Date_registered)
WITH combinations AS (
  SELECT
    n.name,
    s.surname,
    ROW_NUMBER() OVER () AS rn
  FROM temp_names n
  CROSS JOIN temp_surnames s
  CROSS JOIN generate_series(1, 26) AS multiplier
  LIMIT 1000000
)
SELECT
  name,
  surname,
  LOWER(name || '.' || surname || '.' || rn) AS Username,
  LOWER(name || '.' || surname || '.' || rn || '@vidi.mk') AS Email,
  'pbkdf2_sha256$260000$standardhash',
  CURRENT_DATE - (random() * 730)::int
FROM combinations;

--za subscriptions

INSERT INTO User_Subscription (UserUserID, SubscriptionSubscriptionID, Start_date, End_date, Status, Auto_renew)
SELECT
  u.UserID,
  (SELECT SubscriptionID FROM Subscription ORDER BY random() LIMIT 1),
  CURRENT_DATE - (random() * 365)::int,
  CURRENT_DATE + (random() * 365)::int,
  (ARRAY['Active','Active','Active','Inactive','Cancelled'])[ceil(random()*5)::int],
  (random() > 0.5)::int
FROM "User" u;

-- za artists
INSERT INTO Artist (FirstName, LastName, BirthDate, RoleType) VALUES
-- Директори
('Frank', 'Darabont', '1959-01-28', 'Director'),
('Francis Ford', 'Coppola', '1939-04-07', 'Director'),
('Christopher', 'Nolan', '1970-07-30', 'Director'),
('Quentin', 'Tarantino', '1963-03-27', 'Director'),
('David', 'Fincher', '1962-08-28', 'Director'),
('Ridley', 'Scott', '1937-11-30', 'Director'),
('Martin', 'Scorsese', '1942-11-17', 'Director'),
('Bong', 'Joon-ho', '1969-09-14', 'Director'),
('Damien', 'Chazelle', '1985-01-19', 'Director'),
('Vince', 'Gilligan', '1967-02-10', 'Director'),
('David', 'Chase', '1945-08-22', 'Director'),
('David', 'Simon', '1960-02-09', 'Director'),
('Matt', 'Duffer', '1984-02-15', 'Director'),
('Ross', 'Duffer', '1984-02-15', 'Director'),
('David', 'Benioff', '1970-07-25', 'Director'),
('Johan', 'Renck', '1966-01-01', 'Director'),
('Greg', 'Daniels', '1963-01-28', 'Director'),
('Peter', 'Gould', '1964-01-01', 'Director'),
('Eric', 'Kripke', '1974-04-24', 'Director'),
('Baran', 'bo Odar', '1978-04-04', 'Director'),
('Tim', 'Robbins', '1958-10-16', 'Actor'),
('Morgan', 'Freeman', '1937-06-01', 'Actor'),
('Marlon', 'Brando', '1924-04-03', 'Actor'),
('Al', 'Pacino', '1940-04-25', 'Actor'),
('Christian', 'Bale', '1974-01-30', 'Actor'),
('Heath', 'Ledger', '1979-04-04', 'Actor'),
('John', 'Travolta', '1954-02-18', 'Actor'),
('Uma', 'Thurman', '1970-04-29', 'Actor'),
('Leonardo', 'DiCaprio', '1974-11-11', 'Actor'),
('Brad', 'Pitt', '1963-12-18', 'Actor'),
('Keanu', 'Reeves', '1964-09-02', 'Actor'),
('Ray', 'Liotta', '1954-12-18', 'Actor'),
('Kevin', 'Spacey', '1959-07-26', 'Actor'),
('Matthew', 'McConaughey', '1969-11-04', 'Actor'),
('Russell', 'Crowe', '1964-04-07', 'Actor'),
('Song', 'Kang-ho', '1967-01-17', 'Actor'),
('Hugh', 'Jackman', '1968-10-12', 'Actor'),
('Miles', 'Teller', '1987-02-20', 'Actor'),
('Jamie', 'Foxx', '1967-12-13', 'Actor'),
('Bryan', 'Cranston', '1956-03-07', 'Actor'),
('Aaron', 'Paul', '1979-08-27', 'Actor'),
('James', 'Gandolfini', '1961-09-18', 'Actor'),
('Idris', 'Elba', '1972-09-06', 'Actor'),
('Millie Bobby', 'Brown', '2004-02-19', 'Actor'),
('Emilia', 'Clarke', '1986-10-23', 'Actor'),
('Jared', 'Harris', '1961-08-24', 'Actor'),
('Steve', 'Carell', '1962-08-16', 'Actor'),
('Bob', 'Odenkirk', '1962-10-22', 'Actor'),
('Karl', 'Urban', '1972-06-07', 'Actor'),
('Louis', 'Hofmann', '1997-06-04', 'Actor');

