diff --git a/.env b/.env index 33dbc58..fa691d2 100644 --- a/.env +++ b/.env @@ -1,24 +1,23 @@ -# Server Configuration SERVER_PORT=3000 SERVER_HOST=0.0.0.0 # Database Configuration DB_HOST=localhost -DB_PORT=5432 -DB_USER=gitea -DB_PASSWORD=gitea -DB_NAME=gitea -PROJECT_NAME=gitea-ext -DB_SERVICE_NAME=postgres +DB_PORT=3306 +DB_USER=root +DB_PASSWORD=Maal12345678 +DB_NAME=presta +PROJECT_NAME=nalu_b2b +DB_SERVICE_NAME=nalu_b2b DB_SSLMODE=disable # App COnfig -APP_NAME="User Management System" +APP_NAME="B2b Management System" APP_VERSION=2.1.0 APP_ENVIRONMENT=development # JWT Configuration -AUTH_JWT_SECRET=511900e67f2db873e72b0b24e51352227b067fc03c5d7b3d321e3baba317c83a +AUTH_JWT_SECRET=5c020e6ed3d8d6e67e5804d67c83c4bd5ae474df749af6d63d8f20e7e2ba29b3 AUTH_JWT_EXPIRATION=86400 AUTH_REFRESH_EXPIRATION=604800 diff --git a/Taskfile.yml b/Taskfile.yml index 1068a99..43351b4 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -3,40 +3,50 @@ version: "3" dotenv: [".env"] vars: - PROJECT: timetracker + PROJECT: nalu_b2b BUILD_DIR: ./bin REMOTE_USER: root - REMOTE_HOST: 192.168.220.30 + REMOTE_HOST: dc02-de EMAIL_SMTP_PORT: 1025 EMAIL_SMTP_HOST: localhost - GITEA_SERVICE: gitea_postgres_db - GITEA_DB: gitea - GITEA_USER: gitea + + LOCAL_DB_SERVICE: db + LOCAL_DB_USER: nalu + LOCAL_DB_NAME: nalu + LOCAL_DB_PASSWORD: Maal12345678 DUMP_FILE_NAME: - sh: echo gitea_$(date +%Y_%m_%d__%H_%M_%S).sql - GITEA_REMOTE_SERVICE: "gitea_postgres_db" - GITEA_REMOTE_DB_NAME: "gitea" - GITEA_REMOTE_DB_USER: "gitea" - GITEA_REMOTE_DB_PASS: "gitea" + sh: echo nalu_$(date +%Y_%m_%d__%H_%M_%S).sql + REMOTE_DB_SERVICE: "www_naluconcept_com_nalu_db" + REMOTE_DB_NAME: "presta" + REMOTE_DB_USER: "presta" + REMOTE_DB_PASS: "presta" DOCKER_CONFIG: | services: - {{.DB_SERVICE_NAME}}: - image: postgres:alpine - container_name: {{.DB_SERVICE_NAME}} - environment: - POSTGRES_USER: {{.DB_USER}} - POSTGRES_PASSWORD: {{.DB_PASSWORD}} - POSTGRES_DB: {{.DB_NAME}} + {{.LOCAL_DB_SERVICE}}: + image: mariadb:latest + container_name: {{.LOCAL_DB_SERVICE}} + command: + - --innodb_buffer_pool_size=134217728 + - --key_buffer_size=33554432 + - --query_cache_type=1 + - --query_cache_size=67108864 + - --query-cache-strip-comments=1 + - --max-connections=256 + - --event_scheduler=1 + - --log-bin=binlog + - --log_bin_trust_function_creators=1 ports: - - "{{.DB_PORT}}:{{.DB_PORT}}" + - "3306:3306" volumes: - - postgres_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] - interval: 10s - timeout: 5s - retries: 5 + - db_data:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: {{.LOCAL_DB_PASSWORD}} + MYSQL_DATABASE: {{.LOCAL_DB_NAME}} + MARIADB_USER: {{.LOCAL_DB_USER}} + MARIADB_PASSWORD: {{.LOCAL_DB_PASSWORD}} + TZ: CET-1CES + restart: always pdf: image: registry.ma-al.com/print-rs:latest command: start_server @@ -65,7 +75,7 @@ vars: MP_VERBOSE: true volumes: - postgres_data: + db_data: mailpit_data: @@ -74,7 +84,7 @@ includes: dev: ./taskfiles/dev.yml build: ./taskfiles/build.yml db: ./taskfiles/db.yml - gitea: ./taskfiles/gitea.yml + nalu: ./taskfiles/nalu_db.yml i18n: ./taskfiles/i18n.yml tpl: ./taskfiles/templates.yml diff --git a/i18n/migrations/20260302163100_routes.sql b/i18n/migrations/20260302163100_routes.sql index 12ebaf0..ba9e734 100644 --- a/i18n/migrations/20260302163100_routes.sql +++ b/i18n/migrations/20260302163100_routes.sql @@ -1,28 +1,34 @@ -- +goose Up -- create routes table -CREATE TABLE tracker_routes ( - id SERIAL PRIMARY KEY, - name VARCHAR NOT NULL UNIQUE, - path VARCHAR NULL, - component VARCHAR NOT NULL, -- path to component file - layout VARCHAR DEFAULT 'default', -- 'default' | 'empty' - meta JSONB DEFAULT '{}', - is_active BOOLEAN DEFAULT true, +CREATE TABLE IF NOT EXISTS b2b_tracker_routes ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL UNIQUE, + path VARCHAR(255) NULL, + component VARCHAR(255) NOT NULL COMMENT 'path to component file', + layout VARCHAR(50) DEFAULT 'default' COMMENT "'default' | 'empty'", + meta JSON DEFAULT '{}' , + is_active BOOLEAN DEFAULT TRUE, sort_order INT DEFAULT 0, - parent_id INT NULL -); + parent_id INT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 -INSERT INTO "public"."tracker_routes" ("name", "path", "component", "layout", "meta", "is_active", "sort_order", "parent_id") VALUES -('root', '', '', 'default', '{"trans": "route.root"}', false, 0, 0), -('home', '', '@/views/HomeView.vue', 'default', '{"trans": "route.home"}', true, 0, 0), -('login', 'login', '@/views/LoginView.vue', 'empty', '{"guest":true}', true, 2, NULL), -('register', 'register', '@/views/RegisterView.vue', 'empty', '{"guest":true}', true, 3, NULL), -('password-recovery', 'password-recovery', '@/views/PasswordRecoveryView.vue', 'empty', '{"guest":true}', true, 4, NULL), -('reset-password', 'reset-password', '@/views/ResetPasswordView.vue', 'empty', '{"guest":true}', true, 5, NULL), -('verify-email', 'verify-email', '@/views/VerifyEmailView.vue', 'empty', '{"guest":true}', true, 6, NULL); +ALTER TABLE b2b_tracker_routes + ADD CONSTRAINT fk_parent + FOREIGN KEY (parent_id) REFERENCES b2b_tracker_routes(id) + ON DELETE SET NULL; +INSERT IGNORE INTO b2b_tracker_routes + (name, path, component, layout, meta, is_active, sort_order, parent_id) +VALUES + ('root', '', '', 'default', '{"trans": "route.root"}', 0, 0, 0), + ('home', '', '@/views/HomeView.vue', 'default', '{"trans": "route.home"}', 1, 0, 0), + ('login', 'login', '@/views/LoginView.vue', 'empty', '{"guest":true}', 1, 2, NULL), + ('register', 'register', '@/views/RegisterView.vue', 'empty', '{"guest":true}', 1, 3, NULL), + ('password-recovery', 'password-recovery', '@/views/PasswordRecoveryView.vue', 'empty', '{"guest":true}', 1, 4, NULL), + ('reset-password', 'reset-password', '@/views/ResetPasswordView.vue', 'empty', '{"guest":true}', 1, 5, NULL), + ('verify-email', 'verify-email', '@/views/VerifyEmailView.vue', 'empty', '{"guest":true}', 1, 6, NULL); -- +goose Down -DROP TABLE IF EXISTS "public"."tracker_routes"; +DROP TABLE IF EXISTS b2b_tracker_routes; diff --git a/i18n/migrations/20260302163122_create_tables.sql b/i18n/migrations/20260302163122_create_tables.sql index 0754a16..f43e00f 100644 --- a/i18n/migrations/20260302163122_create_tables.sql +++ b/i18n/migrations/20260302163122_create_tables.sql @@ -1,143 +1,127 @@ -- +goose Up -CREATE TABLE IF NOT EXISTS "public"."language" ( - "id" SERIAL, - "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, - "updated_at" TIMESTAMP WITH TIME ZONE NULL, - "deleted_at" TIMESTAMP WITH TIME ZONE NULL, - "name" VARCHAR(128) NOT NULL, - "iso_code" VARCHAR(2) NOT NULL, - "lang_code" VARCHAR(5) NOT NULL, - "date_format" VARCHAR(32) NOT NULL, - "date_format_short" VARCHAR(32) NOT NULL, - "rtl" BOOLEAN NOT NULL DEFAULT false , - "is_default" BOOLEAN NOT NULL DEFAULT false , - "active" BOOLEAN NOT NULL DEFAULT true , - "flag" VARCHAR(16) NOT NULL, - CONSTRAINT "language_pkey" PRIMARY KEY ("id") -); -CREATE INDEX IF NOT EXISTS "idx_language_deleted_at" -ON "public"."language" ( - "deleted_at" ASC -); +CREATE TABLE IF NOT EXISTS b2b_language ( + id INT AUTO_INCREMENT PRIMARY KEY, + created_at DATETIME(6) NOT NULL, + updated_at DATETIME(6) NULL, + deleted_at DATETIME(6) NULL, + name VARCHAR(128) NOT NULL, + iso_code VARCHAR(2) NOT NULL, + lang_code VARCHAR(5) NOT NULL, + date_format VARCHAR(32) NOT NULL, + date_format_short VARCHAR(32) NOT NULL, + rtl TINYINT(1) NOT NULL DEFAULT 0, + is_default TINYINT(1) NOT NULL DEFAULT 0, + active TINYINT(1) NOT NULL DEFAULT 1, + flag VARCHAR(16) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -INSERT INTO "public"."language" ("id", "created_at", "updated_at", "deleted_at", "name", "iso_code", "lang_code", "date_format", "date_format_short", "rtl", "is_default", "active", "flag") VALUES (1, '2022-09-16 17:10:02.837+00', '2026-03-02 21:24:36.77973+00', NULL, 'Polski', 'pl', 'pl', '__-__-____', '__-__', false, false, true, '🇵🇱') ON CONFLICT DO NOTHING; -INSERT INTO "public"."language" ("id", "created_at", "updated_at", "deleted_at", "name", "iso_code", "lang_code", "date_format", "date_format_short", "rtl", "is_default", "active", "flag") VALUES (2, '2022-09-16 17:10:02.852+00', '2026-03-02 21:24:36.77973+00', NULL, 'English', 'en', 'en', '__-__-____', '__-__', false, true, true, '🇬🇧') ON CONFLICT DO NOTHING; -INSERT INTO "public"."language" ("id", "created_at", "updated_at", "deleted_at", "name", "iso_code", "lang_code", "date_format", "date_format_short", "rtl", "is_default", "active", "flag") VALUES (3, '2022-09-16 17:10:02.865+00', '2026-03-02 21:24:36.77973+00', NULL, 'Čeština', 'cs', 'cs', '__-__-____', '__-__', false, false, true, '🇨🇿') ON CONFLICT DO NOTHING; +CREATE INDEX IF NOT EXISTS idx_language_deleted_at +ON b2b_language (deleted_at); +INSERT IGNORE INTO b2b_language + (id, created_at, updated_at, deleted_at, name, iso_code, lang_code, date_format, date_format_short, rtl, is_default, active, flag) +VALUES + (1, '2022-09-16 17:10:02.837', '2026-03-02 21:24:36.779730', NULL, 'Polski', 'pl', 'pl', '__-__-____', '__-__', 0, 0, 1, '🇵🇱'), + (2, '2022-09-16 17:10:02.852', '2026-03-02 21:24:36.779730', NULL, 'English', 'en', 'en', '__-__-____', '__-__', 0, 1, 1, '🇬🇧'), + (3, '2022-09-16 17:10:02.865', '2026-03-02 21:24:36.779730', NULL, 'Čeština', 'cs', 'cs', '__-__-____', '__-__', 0, 0, 1, '🇨🇿'); --- components -CREATE TABLE IF NOT EXISTS "public"."components" ( - "id" SERIAL, - "name" VARCHAR(255) NOT NULL, - CONSTRAINT "components_pkey" PRIMARY KEY ("id") -); -CREATE UNIQUE INDEX IF NOT EXISTS "uk_components_name" -ON "public"."components" ( - "name" ASC, - "id" ASC -); - +CREATE TABLE IF NOT EXISTS b2b_components ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; +CREATE UNIQUE INDEX IF NOT EXISTS uk_components_name ON b2b_components (name, id); -- scopes -CREATE TABLE IF NOT EXISTS "public"."scopes" ( - "id" SERIAL, - "name" VARCHAR(255) NOT NULL, - CONSTRAINT "scopes_pkey" PRIMARY KEY ("id") -); -CREATE UNIQUE INDEX IF NOT EXISTS "uk_scopes_name" -ON "public"."scopes" ( - "name" ASC -); - +CREATE TABLE IF NOT EXISTS b2b_scopes ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; +CREATE UNIQUE INDEX IF NOT EXISTS uk_scopes_name ON b2b_scopes (name); -- translations -CREATE TABLE IF NOT EXISTS "public"."translations" ( - "lang_id" BIGINT NOT NULL, - "scope_id" BIGINT NOT NULL, - "component_id" BIGINT NOT NULL, - "key" VARCHAR(255) NOT NULL, - "data" TEXT NULL, - CONSTRAINT "translations_pkey" PRIMARY KEY ("lang_id", "scope_id", "component_id", "key"), - CONSTRAINT "fk_translations_language" FOREIGN KEY ("lang_id") REFERENCES "public"."language" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT, - CONSTRAINT "fk_translations_scope" FOREIGN KEY ("scope_id") REFERENCES "public"."scopes" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT, - CONSTRAINT "fk_translations_component" FOREIGN KEY ("component_id") REFERENCES "public"."components" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT -); +CREATE TABLE IF NOT EXISTS b2b_translations ( + lang_id INT NOT NULL, + scope_id INT NOT NULL, + component_id INT NOT NULL, + `key` VARCHAR(255) NOT NULL, + data TEXT NULL, + PRIMARY KEY (lang_id, scope_id, component_id, `key`), + CONSTRAINT fk_translations_language FOREIGN KEY (lang_id) REFERENCES b2b_language(id) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT fk_translations_scope FOREIGN KEY (scope_id) REFERENCES b2b_scopes(id) ON DELETE RESTRICT ON UPDATE RESTRICT, + CONSTRAINT fk_translations_component FOREIGN KEY (component_id) REFERENCES b2b_components(id) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; -- customers -CREATE TABLE IF NOT EXISTS "public"."customers" ( - "id" SERIAL, - "email" VARCHAR(255) NOT NULL, - "password" VARCHAR(255) NULL, - "first_name" VARCHAR(100) NULL, - "last_name" VARCHAR(100) NULL, - "role" VARCHAR(20) NULL DEFAULT 'user'::character varying , - "provider" VARCHAR(20) NULL DEFAULT 'local'::character varying , - "provider_id" VARCHAR(255) NULL, - "avatar_url" VARCHAR(500) NULL, - "is_active" BOOLEAN NULL DEFAULT true , - "email_verified" BOOLEAN NULL DEFAULT false , - "email_verification_token" VARCHAR(255) NULL, - "email_verification_expires" TIMESTAMP WITH TIME ZONE NULL, - "password_reset_token" VARCHAR(255) NULL, - "password_reset_expires" TIMESTAMP WITH TIME ZONE NULL, - "last_password_reset_request" TIMESTAMP WITH TIME ZONE NULL, - "last_login_at" TIMESTAMP WITH TIME ZONE NULL, - "lang" VARCHAR(10) NULL DEFAULT 'en'::character varying , - "created_at" TIMESTAMP WITH TIME ZONE NULL, - "updated_at" TIMESTAMP WITH TIME ZONE NULL, - "deleted_at" TIMESTAMP WITH TIME ZONE NULL, - CONSTRAINT "customers_pkey" PRIMARY KEY ("id") -); -CREATE UNIQUE INDEX IF NOT EXISTS "idx_customers_email" -ON "public"."customers" ( - "email" ASC -); -CREATE INDEX IF NOT EXISTS "idx_customers_deleted_at" -ON "public"."customers" ( - "deleted_at" ASC -); +CREATE TABLE IF NOT EXISTS b2b_customers ( + id INT AUTO_INCREMENT PRIMARY KEY, + email VARCHAR(255) NOT NULL, + password VARCHAR(255) NULL, + first_name VARCHAR(100) NULL, + last_name VARCHAR(100) NULL, + role VARCHAR(20) NULL DEFAULT 'user', + provider VARCHAR(20) NULL DEFAULT 'local', + provider_id VARCHAR(255) NULL, + avatar_url VARCHAR(500) NULL, + is_active TINYINT(1) NULL DEFAULT 1, + email_verified TINYINT(1) NULL DEFAULT 0, + email_verification_token VARCHAR(255) NULL, + email_verification_expires DATETIME(6) NULL, + password_reset_token VARCHAR(255) NULL, + password_reset_expires DATETIME(6) NULL, + last_password_reset_request DATETIME(6) NULL, + last_login_at DATETIME(6) NULL, + lang VARCHAR(10) NULL DEFAULT 'en', + created_at DATETIME(6) NULL, + updated_at DATETIME(6) NULL, + deleted_at DATETIME(6) NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE UNIQUE INDEX IF NOT EXISTS idx_customers_email +ON b2b_customers (email); + +CREATE INDEX IF NOT EXISTS idx_customers_deleted_at +ON b2b_customers (deleted_at); -- customer_repo_accesses -CREATE TABLE IF NOT EXISTS "public"."customer_repo_accesses" ( - "user_id" BIGINT NOT NULL, - "repo_id" BIGINT NOT NULL, - PRIMARY KEY ("user_id", "repo_id"), - FOREIGN KEY ("user_id") REFERENCES "public"."customers" ("id") ON DELETE CASCADE, - FOREIGN KEY ("repo_id") REFERENCES "public"."repository" ("id") ON DELETE CASCADE -); +-- CREATE TABLE IF NOT EXISTS b2b_customer_repo_accesses ( +-- user_id BIGINT NOT NULL, +-- repo_id BIGINT NOT NULL, +-- PRIMARY KEY (user_id, repo_id), +-- CONSTRAINT fk_customer_repo_user +-- FOREIGN KEY (user_id) REFERENCES b2b_customers(id) +-- ON DELETE CASCADE, +-- CONSTRAINT fk_customer_repo_repo +-- FOREIGN KEY (repo_id) REFERENCES repository(id) +-- ON DELETE CASCADE +-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- refresh_tokens -CREATE TABLE IF NOT EXISTS "public"."refresh_tokens" ( - "id" SERIAL, - "customer_id" BIGINT NOT NULL, - "token_hash" VARCHAR(64) NOT NULL, - "expires_at" TIMESTAMP WITH TIME ZONE NOT NULL, - "created_at" TIMESTAMP WITH TIME ZONE NOT NULL, - CONSTRAINT "refresh_tokens_pkey" PRIMARY KEY ("id"), - CONSTRAINT "fk_refresh_tokens_customer" FOREIGN KEY ("customer_id") REFERENCES "public"."customers" ("id") ON DELETE CASCADE -); -CREATE UNIQUE INDEX IF NOT EXISTS "uk_refresh_tokens_token_hash" -ON "public"."refresh_tokens" ( - "token_hash" ASC -); -CREATE INDEX IF NOT EXISTS "idx_refresh_tokens_customer_id" -ON "public"."refresh_tokens" ( - "customer_id" ASC -); +CREATE TABLE IF NOT EXISTS b2b_refresh_tokens ( + id INT AUTO_INCREMENT PRIMARY KEY, + customer_id INT NOT NULL, + token_hash VARCHAR(64) NOT NULL, + expires_at DATETIME(6) NOT NULL, + created_at DATETIME(6) NOT NULL, + CONSTRAINT fk_refresh_tokens_customer FOREIGN KEY (customer_id) REFERENCES b2b_customers(id) ON DELETE CASCADE +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; +CREATE UNIQUE INDEX IF NOT EXISTS uk_refresh_tokens_token_hash ON b2b_refresh_tokens (token_hash); +CREATE INDEX IF NOT EXISTS idx_refresh_tokens_customer_id ON b2b_refresh_tokens (customer_id); -- insert sample admin user admin@ma-al.com/Maal12345678 -INSERT INTO "public"."customers" ("id", "email", "password", "first_name", "last_name", "role", "provider", "provider_id", "avatar_url", "is_active", "email_verified", "email_verification_token", "email_verification_expires", "password_reset_token", "password_reset_expires", "last_password_reset_request", "last_login_at", "lang", "created_at", "updated_at", "deleted_at") VALUES (1, 'admin@ma-al.com', '$2a$10$Owy9DjrS0l3Fz4XoOvh5pulgmOMqdwXmb7hYE9BovnSuWS2plGr82', 'Super', 'Admin', 'admin', 'local', '', '', true, true, NULL, NULL, '', NULL, NULL, NULL, 'pl', '2026-03-02 16:55:10.25274+00', '2026-03-02 16:55:10.25274+00', NULL) ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_customers (id, email, password, first_name, last_name, role, provider, provider_id, avatar_url, is_active, email_verified, email_verification_token, email_verification_expires, password_reset_token, password_reset_expires, last_password_reset_request, last_login_at, lang, created_at, updated_at, deleted_at) +VALUES + (1, 'admin@ma-al.com', '$2a$10$Owy9DjrS0l3Fz4XoOvh5pulgmOMqdwXmb7hYE9BovnSuWS2plGr82', 'Super', 'Admin', 'admin', 'local', '', '', 1, 1, NULL, NULL, '', NULL, NULL, NULL, 'pl', '2026-03-02 16:55:10.252740', '2026-03-02 16:55:10.252740', NULL); -- +goose Down -DROP TABLE IF EXISTS "public"."language"; -DROP TABLE IF EXISTS "public"."components"; -DROP TABLE IF EXISTS "public"."scopes"; -DROP TABLE IF EXISTS "public"."translations"; -DROP TABLE IF EXISTS "public"."customers"; -DROP TABLE IF EXISTS "public"."refresh_tokens"; +DROP TABLE IF EXISTS b2b_language; +DROP TABLE IF EXISTS b2b_components; +DROP TABLE IF EXISTS b2b_scopes; +DROP TABLE IF EXISTS b2b_translations; +DROP TABLE IF EXISTS b2b_customers; +DROP TABLE IF EXISTS b2b_refresh_tokens; diff --git a/i18n/migrations/20260302163152_translations_backoffice.sql b/i18n/migrations/20260302163152_translations_backoffice.sql index 9d83cca..45d8803 100644 --- a/i18n/migrations/20260302163152_translations_backoffice.sql +++ b/i18n/migrations/20260302163152_translations_backoffice.sql @@ -2,272 +2,271 @@ -- Dump translations from database -- Components -INSERT INTO components (id, name) VALUES -(1, 'be'), -(2, 'login'), -(3, 'verify_email'), -(100, 'email'), -(101, 'error'), -(102, 'auth'), -(103, 'email'), -(300, 'general'), -(301, 'validate_error'), -(302, 'repo_chart'), -(303, 'verify_email') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_components (id, name) VALUES + (1, 'be'), + (2, 'login'), + (3, 'verify_email'), + (100, 'email'), + (101, 'error'), + (102, 'auth'), + (103, 'email'), + (300, 'general'), + (301, 'validate_error'), + (302, 'repo_chart'), + (303, 'verify_email'); -- Scope -INSERT INTO scopes (id, name) VALUES (3, 'backoffice') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_scopes (id, name) VALUES + (3, 'backoffice'); -- Translations -- Component: general -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 3, 300, 'already_have_an_account', 'Masz już konto?'), -(1, 3, 300, 'and', 'i'), -(1, 3, 300, 'back_to_sign_in', 'Powrót do logowania'), -(1, 3, 300, 'by_signing_in_you_agree_to_our', 'Logując się, zgadzasz się z naszymi'), -(1, 3, 300, 'check_your_email', 'Sprawdź swoją skrzynkę e-mail'), -(1, 3, 300, 'close', 'zamknij'), -(1, 3, 300, 'confirm_password', 'Potwierdź hasło'), -(1, 3, 300, 'confirm_your_new_password', 'Potwierdź swoje nowe hasło'), -(1, 3, 300, 'confirm_your_password', 'Potwierdź swoje hasło'), -(1, 3, 300, 'continue_with_google', 'Kontynuuj z Google'), -(1, 3, 300, 'create_account', 'Utwórz konto'), -(1, 3, 300, 'create_account_now', 'Utwórz konto teraz'), -(1, 3, 300, 'dont_have_an_account', 'Nie masz konta'), -(1, 3, 300, 'email_address', 'Adres e-mail'), -(1, 3, 300, 'enter_email_for_password_reset', 'Wpisz swój adres e-mail, a wyślemy Ci link do zresetowania hasła.'), -(1, 3, 300, 'enter_your_email', 'Wpisz swój adres e-mail'), -(1, 3, 300, 'enter_your_new_password', 'Wpisz swoje nowe hasło'), -(1, 3, 300, 'enter_your_password', 'Wpisz swoje hasło'), -(1, 3, 300, 'first_name', 'Imię'), -(1, 3, 300, 'forgot_password', 'Zapomniałeś hasła'), -(1, 3, 300, 'i_agree_to_the', 'Zgadzam się z'), -(1, 3, 300, 'last_name', 'Nazwisko'), -(1, 3, 300, 'logout', 'Wyloguj się'), -(1, 3, 300, 'new_password', 'Nowe hasło'), -(1, 3, 300, 'or', 'albo'), -(1, 3, 300, 'password', 'Hasło'), -(1, 3, 300, 'password_reset_link_sent_notice', 'Jeśli konto z tym adresem e-mail istnieje, wysłaliśmy link do resetowania hasła. Sprawdź swoją skrzynkę odbiorczą'), -(1, 3, 300, 'password_updated', 'Hasło zaktualizowane'), -(1, 3, 300, 'password_updated_description', 'Twoje hasło zostało pomyślnie zaktualizowane'), -(1, 3, 300, 'privacy_policy', 'Polityka prywatności'), -(1, 3, 300, 'reset_password', 'Resetuj hasło'), -(1, 3, 300, 'send_password_reset_link', 'Wyślij link do resetowania hasła'), -(1, 3, 300, 'sign_in', 'Zaloguj się'), -(1, 3, 300, 'terms_of_service', 'Regulamin'), -(2, 3, 300, 'already_have_an_account', 'Already have an account?'), -(2, 3, 300, 'and', 'and'), -(2, 3, 300, 'back_to_sign_in', 'Back to Sign In'), -(2, 3, 300, 'by_signing_in_you_agree_to_our', 'By signing in, you agree to our terms'), -(2, 3, 300, 'check_your_email', 'Check your email'), -(2, 3, 300, 'close', 'close'), -(2, 3, 300, 'confirm_password', 'Confirm password'), -(2, 3, 300, 'confirm_your_new_password', 'Confirm your new password'), -(2, 3, 300, 'confirm_your_password', 'Confirm your password'), -(2, 3, 300, 'continue_with_google', 'Continue with Google'), -(2, 3, 300, 'create_account', 'Create account'), -(2, 3, 300, 'create_account_now', 'Create an account now'), -(2, 3, 300, 'dont_have_an_account', 'Don''t have an account'), -(2, 3, 300, 'email_address', 'Email address'), -(2, 3, 300, 'enter_email_for_password_reset', 'Enter your email address, and we’ll send you a link to reset your password.'), -(2, 3, 300, 'enter_your_email', 'Enter your email'), -(2, 3, 300, 'enter_your_new_password', 'Enter your new password'), -(2, 3, 300, 'enter_your_password', 'Enter your password'), -(2, 3, 300, 'first_name', 'First name'), -(2, 3, 300, 'forgot_password', 'Forgot password'), -(2, 3, 300, 'i_agree_to_the', 'I agree to the'), -(2, 3, 300, 'last_name', 'Last name'), -(2, 3, 300, 'logout', 'Logout'), -(2, 3, 300, 'new_password', 'New password'), -(2, 3, 300, 'or', 'or'), -(2, 3, 300, 'password', 'Password'), -(2, 3, 300, 'password_reset_link_sent_notice', 'If an account with that email exists, we have sent a password reset link. Please check your inbox.'), -(2, 3, 300, 'password_updated', 'Password updated'), -(2, 3, 300, 'password_updated_description', 'Your password has been successfully updated'), -(2, 3, 300, 'privacy_policy', 'Privacy Policy'), -(2, 3, 300, 'reset_password', 'Reset Password'), -(2, 3, 300, 'send_password_reset_link', 'Send password reset link'), -(2, 3, 300, 'sign_in', 'Sign in'), -(2, 3, 300, 'terms_of_service', 'Terms of Service'), -(3, 3, 300, 'already_have_an_account', 'Už máte účet?'), -(3, 3, 300, 'and', 'a'), -(3, 3, 300, 'back_to_sign_in', 'Zpět k přihlášení'), -(3, 3, 300, 'by_signing_in_you_agree_to_our', 'Přihlášením souhlasíte s našimi'), -(3, 3, 300, 'check_your_email', 'Zkontrolujte svůj e-mail'), -(3, 3, 300, 'close', 'zavřít'), -(3, 3, 300, 'confirm_password', 'Potvrzení hesla'), -(3, 3, 300, 'confirm_your_new_password', 'Potvrďte své nové heslo'), -(3, 3, 300, 'confirm_your_password', 'Potvrďte své heslo'), -(3, 3, 300, 'continue_with_google', 'Pokračovat s Googlem'), -(3, 3, 300, 'create_account', 'Vytvořit účet'), -(3, 3, 300, 'create_account_now', 'Vytvořte účet nyní'), -(3, 3, 300, 'dont_have_an_account', 'Nemáte účet'), -(3, 3, 300, 'email_address', 'E-mailová adresa'), -(3, 3, 300, 'enter_email_for_password_reset', 'Zadejte svou e-mailovou adresu a pošleme vám odkaz pro obnovení hesla.'), -(3, 3, 300, 'enter_your_email', 'Zadejte svůj e-mail'), -(3, 3, 300, 'enter_your_new_password', 'Zadejte své nové heslo'), -(3, 3, 300, 'enter_your_password', 'Zadejte své heslo'), -(3, 3, 300, 'first_name', 'Křestní jméno'), -(3, 3, 300, 'forgot_password', 'Zapomněli jste heslo'), -(3, 3, 300, 'i_agree_to_the', 'Souhlasím s'), -(3, 3, 300, 'last_name', 'Příjmení'), -(3, 3, 300, 'logout', 'Odhlásit se'), -(3, 3, 300, 'new_password', 'Nové heslo'), -(3, 3, 300, 'or', 'nebo'), -(3, 3, 300, 'password', 'Heslo'), -(3, 3, 300, 'password_reset_link_sent_notice', 'Pokud účet s touto e-mailovou adresou existuje, poslali jsme odkaz pro obnovení hesla. Zkontrolujte svůj inbox.'), -(3, 3, 300, 'password_updated', 'Heslo aktualizováno'), -(3, 3, 300, 'password_updated_description', 'Vaše heslo bylo úspěšně aktualizováno'), -(3, 3, 300, 'privacy_policy', 'Zásady ochrany osobních údajů'), -(3, 3, 300, 'reset_password', 'Resetovat heslo'), -(3, 3, 300, 'send_password_reset_link', 'Odeslat odkaz pro obnovení hesla'), -(3, 3, 300, 'sign_in', 'Přihlásit se'), -(3, 3, 300, 'terms_of_service', 'Podmínky služby') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_translations + (lang_id, scope_id, component_id, `key`, data) +VALUES + (1, 3, 300, 'already_have_an_account', 'Masz już konto?'), + (1, 3, 300, 'and', 'i'), + (1, 3, 300, 'back_to_sign_in', 'Powrót do logowania'), + (1, 3, 300, 'by_signing_in_you_agree_to_our', 'Logując się, zgadzasz się z naszymi'), + (1, 3, 300, 'check_your_email', 'Sprawdź swoją skrzynkę e-mail'), + (1, 3, 300, 'confirm_password', 'Potwierdź hasło'), + (1, 3, 300, 'confirm_your_new_password', 'Potwierdź swoje nowe hasło'), + (1, 3, 300, 'confirm_your_password', 'Potwierdź swoje hasło'), + (1, 3, 300, 'continue_with_google', 'Kontynuuj z Google'), + (1, 3, 300, 'create_account', 'Utwórz konto'), + (1, 3, 300, 'create_account_now', 'Utwórz konto teraz'), + (1, 3, 300, 'dont_have_an_account', 'Nie masz konta'), + (1, 3, 300, 'email_address', 'Adres e-mail'), + (1, 3, 300, 'enter_email_for_password_reset', 'Wpisz swój adres e-mail, a wyślemy Ci link do zresetowania hasła.'), + (1, 3, 300, 'enter_your_email', 'Wpisz swój adres e-mail'), + (1, 3, 300, 'enter_your_new_password', 'Wpisz swoje nowe hasło'), + (1, 3, 300, 'enter_your_password', 'Wpisz swoje hasło'), + (1, 3, 300, 'first_name', 'Imię'), + (1, 3, 300, 'forgot_password', 'Zapomniałeś hasła'), + (1, 3, 300, 'i_agree_to_the', 'Zgadzam się z'), + (1, 3, 300, 'last_name', 'Nazwisko'), + (1, 3, 300, 'new_password', 'Nowe hasło'), + (1, 3, 300, 'password', 'Hasło'), + (1, 3, 300, 'password_reset_link_sent_notice', 'Jeśli konto z tym adresem e-mail istnieje, wysłaliśmy link do resetowania hasła. Sprawdź swoją skrzynkę odbiorczą'), + (1, 3, 300, 'password_updated', 'Hasło zaktualizowane'), + (1, 3, 300, 'password_updated_description', 'Twoje hasło zostało pomyślnie zaktualizowane'), + (1, 3, 300, 'privacy_policy', 'Polityka prywatności'), + (1, 3, 300, 'reset_password', 'Resetuj hasło'), + (1, 3, 300, 'send_password_reset_link', 'Wyślij link do resetowania hasła'), + (1, 3, 300, 'sign_in', 'Zaloguj się'), + (1, 3, 300, 'terms_of_service', 'Regulamin'), + (2, 3, 300, 'already_have_an_account', 'Already have an account?'), + (2, 3, 300, 'and', 'and'), + (2, 3, 300, 'back_to_sign_in', 'Back to Sign In'), + (2, 3, 300, 'by_signing_in_you_agree_to_our', 'By signing in, you agree to our terms'), + (2, 3, 300, 'check_your_email', 'Check your email'), + (2, 3, 300, 'confirm_password', 'Confirm password'), + (2, 3, 300, 'confirm_your_new_password', 'Confirm your new password'), + (2, 3, 300, 'confirm_your_password', 'Confirm your password'), + (2, 3, 300, 'continue_with_google', 'Continue with Google'), + (2, 3, 300, 'create_account', 'Create account'), + (2, 3, 300, 'create_account_now', 'Create an account now'), + (2, 3, 300, 'dont_have_an_account', 'Don''t have an account'), + (2, 3, 300, 'email_address', 'Email address'), + (2, 3, 300, 'enter_email_for_password_reset', 'Enter your email address, and we’ll send you a link to reset your password.'), + (2, 3, 300, 'enter_your_email', 'Enter your email'), + (2, 3, 300, 'enter_your_new_password', 'Enter your new password'), + (2, 3, 300, 'enter_your_password', 'Enter your password'), + (2, 3, 300, 'first_name', 'First name'), + (2, 3, 300, 'forgot_password', 'Forgot password'), + (2, 3, 300, 'i_agree_to_the', 'I agree to the'), + (2, 3, 300, 'last_name', 'Last name'), + (2, 3, 300, 'new_password', 'New password'), + (2, 3, 300, 'password', 'Password'), + (2, 3, 300, 'password_reset_link_sent_notice', 'If an account with that email exists, we have sent a password reset link. Please check your inbox.'), + (2, 3, 300, 'password_updated', 'Password updated'), + (2, 3, 300, 'password_updated_description', 'Your password has been successfully updated'), + (2, 3, 300, 'privacy_policy', 'Privacy Policy'), + (2, 3, 300, 'reset_password', 'Reset Password'), + (2, 3, 300, 'send_password_reset_link', 'Send password reset link'), + (2, 3, 300, 'sign_in', 'Sign in'), + (2, 3, 300, 'terms_of_service', 'Terms of Service'), + (3, 3, 300, 'already_have_an_account', 'Už máte účet?'), + (3, 3, 300, 'and', 'a'), + (3, 3, 300, 'back_to_sign_in', 'Zpět k přihlášení'), + (3, 3, 300, 'by_signing_in_you_agree_to_our', 'Přihlášením souhlasíte s našimi'), + (3, 3, 300, 'check_your_email', 'Zkontrolujte svůj e-mail'), + (3, 3, 300, 'confirm_password', 'Potvrzení hesla'), + (3, 3, 300, 'confirm_your_new_password', 'Potvrďte své nové heslo'), + (3, 3, 300, 'confirm_your_password', 'Potvrďte své heslo'), + (3, 3, 300, 'continue_with_google', 'Pokračovat s Googlem'), + (3, 3, 300, 'create_account', 'Vytvořit účet'), + (3, 3, 300, 'create_account_now', 'Vytvořte účet nyní'), + (3, 3, 300, 'dont_have_an_account', 'Nemáte účet'), + (3, 3, 300, 'email_address', 'E-mailová adresa'), + (3, 3, 300, 'enter_email_for_password_reset', 'Zadejte svou e-mailovou adresu a pošleme vám odkaz pro obnovení hesla.'), + (3, 3, 300, 'enter_your_email', 'Zadejte svůj e-mail'), + (3, 3, 300, 'enter_your_new_password', 'Zadejte své nové heslo'), + (3, 3, 300, 'enter_your_password', 'Zadejte své heslo'), + (3, 3, 300, 'first_name', 'Křestní jméno'), + (3, 3, 300, 'forgot_password', 'Zapomněli jste heslo'), + (3, 3, 300, 'i_agree_to_the', 'Souhlasím s'), + (3, 3, 300, 'last_name', 'Příjmení'), + (3, 3, 300, 'new_password', 'Nové heslo'), + (3, 3, 300, 'password', 'Heslo'), + (3, 3, 300, 'password_reset_link_sent_notice', 'Pokud účet s touto e-mailovou adresou existuje, poslali jsme odkaz pro obnovení hesla. Zkontrolujte svůj inbox.'), + (3, 3, 300, 'password_updated', 'Heslo aktualizováno'), + (3, 3, 300, 'password_updated_description', 'Vaše heslo bylo úspěšně aktualizováno'), + (3, 3, 300, 'privacy_policy', 'Zásady ochrany osobních údajů'), + (3, 3, 300, 'reset_password', 'Resetovat heslo'), + (3, 3, 300, 'send_password_reset_link', 'Odeslat odkaz pro obnovení hesla'), + (3, 3, 300, 'sign_in', 'Přihlásit se'), + (3, 3, 300, 'terms_of_service', 'Podmínky služby'); -- Component: validate_error -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 3, 301, 'confirm_password_required', 'Potwierdź hasło'), -(1, 3, 301, 'email_required', 'Adres e-mail jest wymagany'), -(1, 3, 301, 'first_name_required', 'Imię jest wymagane'), -(1, 3, 301, 'last_name_required', 'Nazwisko jest wymagane'), -(1, 3, 301, 'no_issues_for_quarter', 'Nie znaleziono zgłoszeń w tym kwartale'), -(1, 3, 301, 'password_required', 'Hasło jest wymagane'), -(1, 3, 301, 'registration_validation_password_not_same', 'Hasła nie są takie same'), -(1, 3, 301, 'registration_validation_password_requirements', 'Wymagania dotyczące hasła przy rejestracji'), -(2, 3, 301, 'confirm_password_required', 'Confirm password is required'), -(2, 3, 301, 'email_required', 'Email is required'), -(2, 3, 301, 'first_name_required', 'First name is required'), -(2, 3, 301, 'last_name_required', 'Last name is required'), -(2, 3, 301, 'no_issues_for_quarter', 'No issues found for this quarter'), -(2, 3, 301, 'password_required', 'Password is required'), -(2, 3, 301, 'registration_validation_password_not_same', 'Passwords do not match'), -(2, 3, 301, 'registration_validation_password_requirements', 'Password requirements for registration'), -(3, 3, 301, 'confirm_password_required', 'Potvrďte heslo'), -(3, 3, 301, 'email_required', 'E-mail je povinný'), -(3, 3, 301, 'first_name_required', 'Jméno je povinné'), -(3, 3, 301, 'last_name_required', 'Příjmení je povinné'), -(3, 3, 301, 'no_issues_for_quarter', 'Nebyla nalezena žádná issues pro toto čtvrtletí'), -(3, 3, 301, 'password_required', 'Heslo je povinné'), -(3, 3, 301, 'registration_validation_password_not_same', 'Hesla se neshodují'), -(3, 3, 301, 'registration_validation_password_requirements', 'Požadavky na heslo při registraci') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_translations + (lang_id, scope_id, component_id, `key`, data) +VALUES + (1, 3, 301, 'confirm_password_required', 'Potwierdź hasło'), + (1, 3, 301, 'email_required', 'Adres e-mail jest wymagany'), + (1, 3, 301, 'first_name_required', 'Imię jest wymagane'), + (1, 3, 301, 'last_name_required', 'Nazwisko jest wymagane'), + (1, 3, 301, 'no_issues_for_quarter', 'Nie znaleziono zgłoszeń w tym kwartale'), + (1, 3, 301, 'password_required', 'Hasło jest wymagane'), + (1, 3, 301, 'registration_validation_password_not_same', 'Hasła nie są takie same'), + (1, 3, 301, 'registration_validation_password_requirements', 'Wymagania dotyczące hasła przy rejestracji'), + (2, 3, 301, 'confirm_password_required', 'Confirm password is required'), + (2, 3, 301, 'email_required', 'Email is required'), + (2, 3, 301, 'first_name_required', 'First name is required'), + (2, 3, 301, 'last_name_required', 'Last name is required'), + (2, 3, 301, 'no_issues_for_quarter', 'No issues found for this quarter'), + (2, 3, 301, 'password_required', 'Password is required'), + (2, 3, 301, 'registration_validation_password_not_same', 'Passwords do not match'), + (2, 3, 301, 'registration_validation_password_requirements', 'Password requirements for registration'), + (3, 3, 301, 'confirm_password_required', 'Potvrďte heslo'), + (3, 3, 301, 'email_required', 'E-mail je povinný'), + (3, 3, 301, 'first_name_required', 'Jméno je povinné'), + (3, 3, 301, 'last_name_required', 'Příjmení je povinné'), + (3, 3, 301, 'no_issues_for_quarter', 'Nebyla nalezena žádná issues pro toto čtvrtletí'), + (3, 3, 301, 'password_required', 'Heslo je povinné'), + (3, 3, 301, 'registration_validation_password_not_same', 'Hesla se neshodují'), + (3, 3, 301, 'registration_validation_password_requirements', 'Požadavky na heslo při registraci'); -- Component: repo_chart -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 3, 302, 'all_quarters', 'Wszystkie kwartały'), -(1, 3, 302, 'created_on', 'Utworzono'), -(1, 3, 302, 'failed_to_load_issues', 'Nie udało się załadować zadań'), -(1, 3, 302, 'failed_to_load_quarters', 'Nie udało się załadować kwartałów'), -(1, 3, 302, 'failed_to_load_repositories', 'Nie udało się załadować repozytoriów'), -(1, 3, 302, 'failed_to_load_years', 'Nie udało się załadować lat'), -(1, 3, 302, 'hours', 'Godziny'), -(1, 3, 302, 'hours_spent', 'Spędzone godziny'), -(1, 3, 302, 'hours_worked', 'Przepracowane godziny'), -(1, 3, 302, 'issue_name', 'Nazwa zadania'), -(1, 3, 302, 'issues_for', 'Zadania dla'), -(1, 3, 302, 'loading', 'Ładowanie'), -(1, 3, 302, 'login_to_view_charts', 'Zaloguj się, aby zobaczyć wykresy pracy repozytoriów.'), -(1, 3, 302, 'no_work_data_available', 'Brak danych o pracy dla wybranych kryteriów.'), -(1, 3, 302, 'quarter', 'Kwartał'), -(1, 3, 302, 'repository', 'Repozytorium'), -(1, 3, 302, 'repository_work_chart', 'Wykres pracy repozytorium'), -(1, 3, 302, 'select_a_repository', 'Wybierz repozytorium'), -(1, 3, 302, 'select_a_year', 'Wybrany rok'), -(1, 3, 302, 'select_quarter_to_view_issues', 'Proszę wybrać kwartał, aby zobaczyć zadania.'), -(1, 3, 302, 'select_repo_to_view_data', 'Proszę wybrać repozytorium, aby zobaczyć dane o pracy.'), -(1, 3, 302, 'select_year_to_view_data', 'Proszę wybrać rok, aby zobaczyć dane o pracy.'), -(1, 3, 302, 'user_initials', 'Inicjały użytkownika'), -(1, 3, 302, 'work_by_quarter', 'Wykonana praca według kwartałów (godziny)'), -(1, 3, 302, 'work_done_by_quarter', 'Wykonana praca według kwartałów'), -(1, 3, 302, 'year', 'Rok'), -(2, 3, 302, 'all_quarters', 'All Quarters'), -(2, 3, 302, 'created_on', 'Created On'), -(2, 3, 302, 'failed_to_load_issues', 'Failed to load issues'), -(2, 3, 302, 'failed_to_load_quarters', 'Failed to load quarters'), -(2, 3, 302, 'failed_to_load_repositories', 'Failed to load repositories'), -(2, 3, 302, 'failed_to_load_years', 'Failed to load years'), -(2, 3, 302, 'hours', 'Hours'), -(2, 3, 302, 'hours_spent', 'Hours Spent'), -(2, 3, 302, 'hours_worked', 'Hours Worked'), -(2, 3, 302, 'issue_name', 'Issue Name'), -(2, 3, 302, 'issues_for', 'Issues for'), -(2, 3, 302, 'loading', 'Loading'), -(2, 3, 302, 'login_to_view_charts', 'Please log in to view repository work charts.'), -(2, 3, 302, 'no_work_data_available', 'No work data available for the selected criteria.'), -(2, 3, 302, 'quarter', 'Quarter'), -(2, 3, 302, 'repository', 'Repository'), -(2, 3, 302, 'repository_work_chart', 'Repository Work Chart'), -(2, 3, 302, 'select_a_repository', 'Select a repository'), -(2, 3, 302, 'select_a_year', 'Select a year'), -(2, 3, 302, 'select_quarter_to_view_issues', 'Please select a quarter to view issues.'), -(2, 3, 302, 'select_repo_to_view_data', 'Please select a repository to view work data.'), -(2, 3, 302, 'select_year_to_view_data', 'Please select a year to view work data.'), -(2, 3, 302, 'user_initials', 'User Initials'), -(2, 3, 302, 'work_by_quarter', 'Work Done by Quarter (Hours)'), -(2, 3, 302, 'work_done_by_quarter', 'Work Done by Quarter'), -(2, 3, 302, 'year', 'Year'), -(3, 3, 302, 'all_quarters', 'Všechna čtvrtletí'), -(3, 3, 302, 'created_on', 'Vytvořeno'), -(3, 3, 302, 'failed_to_load_issues', 'Problémy se nepodařilo načíst'), -(3, 3, 302, 'failed_to_load_quarters', 'Nepodařilo se načíst čtvrtletí'), -(3, 3, 302, 'failed_to_load_repositories', 'Nepodařilo se načíst repozitáře'), -(3, 3, 302, 'failed_to_load_years', 'Nepodařilo se načíst roky'), -(3, 3, 302, 'hours', 'Hodiny'), -(3, 3, 302, 'hours_spent', 'Strávené hodiny'), -(3, 3, 302, 'hours_worked', 'Odpracované hodiny'), -(3, 3, 302, 'issue_name', 'Název úkolu'), -(3, 3, 302, 'issues_for', 'úkoly pro'), -(3, 3, 302, 'loading', 'Načítání'), -(3, 3, 302, 'login_to_view_charts', 'Přihlaste se pro zobrazení grafů práce repozitářů.'), -(3, 3, 302, 'no_work_data_available', 'Pro zvolená kritéria nejsou k dispozici žádná pracovní data.'), -(3, 3, 302, 'quarter', 'Čtvrtletí'), -(3, 3, 302, 'repository', 'Repozitář'), -(3, 3, 302, 'repository_work_chart', 'Graf práce úložiště'), -(3, 3, 302, 'select_a_repository', 'Vyberte repozitář'), -(3, 3, 302, 'select_a_year', 'Vyberte rok'), -(3, 3, 302, 'select_quarter_to_view_issues', 'Vyberte prosím čtvrtletí pro zobrazení úkolů.'), -(3, 3, 302, 'select_repo_to_view_data', 'Vyberte prosím repozitář pro zobrazení pracovních dat.'), -(3, 3, 302, 'select_year_to_view_data', 'Vyberte prosím rok pro zobrazení pracovních dat.'), -(3, 3, 302, 'user_initials', 'Iniciály uživatele'), -(3, 3, 302, 'work_by_quarter', 'Práce dokončená po čtvrtletích (hodiny)'), -(3, 3, 302, 'work_done_by_quarter', 'práce provedená za čtvrtletí'), -(3, 3, 302, 'year', 'Rok') ON CONFLICT DO NOTHING; - +INSERT IGNORE INTO b2b_translations + (lang_id, scope_id, component_id, `key`, data) +VALUES + (1, 3, 302, 'all_quarters', 'Wszystkie kwartały'), + (1, 3, 302, 'created_on', 'Utworzono'), + (1, 3, 302, 'failed_to_load_issues', 'Nie udało się załadować zadań'), + (1, 3, 302, 'failed_to_load_quarters', 'Nie udało się załadować kwartałów'), + (1, 3, 302, 'failed_to_load_repositories', 'Nie udało się załadować repozytoriów'), + (1, 3, 302, 'failed_to_load_years', 'Nie udało się załadować lat'), + (1, 3, 302, 'hours', 'Godziny'), + (1, 3, 302, 'hours_spent', 'Spędzone godziny'), + (1, 3, 302, 'hours_worked', 'Przepracowane godziny'), + (1, 3, 302, 'issue_name', 'Nazwa zadania'), + (1, 3, 302, 'issues_for', 'Zadania dla'), + (1, 3, 302, 'loading', 'Ładowanie'), + (1, 3, 302, 'login_to_view_charts', 'Zaloguj się, aby zobaczyć wykresy pracy repozytoriów.'), + (1, 3, 302, 'no_work_data_available', 'Brak danych o pracy dla wybranych kryteriów.'), + (1, 3, 302, 'quarter', 'Kwartał'), + (1, 3, 302, 'repository', 'Repozytorium'), + (1, 3, 302, 'repository_work_chart', 'Wykres pracy repozytorium'), + (1, 3, 302, 'select_a_repository', 'Wybierz repozytorium'), + (1, 3, 302, 'select_a_year', 'Wybrany rok'), + (1, 3, 302, 'select_quarter_to_view_issues', 'Proszę wybrać kwartał, aby zobaczyć zadania.'), + (1, 3, 302, 'select_repo_to_view_data', 'Proszę wybrać repozytorium, aby zobaczyć dane o pracy.'), + (1, 3, 302, 'select_year_to_view_data', 'Proszę wybrać rok, aby zobaczyć dane o pracy.'), + (1, 3, 302, 'user_initials', 'Inicjały użytkownika'), + (1, 3, 302, 'work_by_quarter', 'Wykonana praca według kwartałów (godziny)'), + (1, 3, 302, 'work_done_by_quarter', 'Wykonana praca według kwartałów'), + (1, 3, 302, 'year', 'Rok'), + (2, 3, 302, 'all_quarters', 'All Quarters'), + (2, 3, 302, 'created_on', 'Created On'), + (2, 3, 302, 'failed_to_load_issues', 'Failed to load issues'), + (2, 3, 302, 'failed_to_load_quarters', 'Failed to load quarters'), + (2, 3, 302, 'failed_to_load_repositories', 'Failed to load repositories'), + (2, 3, 302, 'failed_to_load_years', 'Failed to load years'), + (2, 3, 302, 'hours', 'Hours'), + (2, 3, 302, 'hours_spent', 'Hours Spent'), + (2, 3, 302, 'hours_worked', 'Hours Worked'), + (2, 3, 302, 'issue_name', 'Issue Name'), + (2, 3, 302, 'issues_for', 'Issues for'), + (2, 3, 302, 'loading', 'Loading'), + (2, 3, 302, 'login_to_view_charts', 'Please log in to view repository work charts.'), + (2, 3, 302, 'no_work_data_available', 'No work data available for the selected criteria.'), + (2, 3, 302, 'quarter', 'Quarter'), + (2, 3, 302, 'repository', 'Repository'), + (2, 3, 302, 'repository_work_chart', 'Repository Work Chart'), + (2, 3, 302, 'select_a_repository', 'Select a repository'), + (2, 3, 302, 'select_a_year', 'Select a year'), + (2, 3, 302, 'select_quarter_to_view_issues', 'Please select a quarter to view issues.'), + (2, 3, 302, 'select_repo_to_view_data', 'Please select a repository to view work data.'), + (2, 3, 302, 'select_year_to_view_data', 'Please select a year to view work data.'), + (2, 3, 302, 'user_initials', 'User Initials'), + (2, 3, 302, 'work_by_quarter', 'Work Done by Quarter (Hours)'), + (2, 3, 302, 'work_done_by_quarter', 'Work Done by Quarter'), + (2, 3, 302, 'year', 'Year'), + (3, 3, 302, 'all_quarters', 'Všechna čtvrtletí'), + (3, 3, 302, 'created_on', 'Vytvořeno'), + (3, 3, 302, 'failed_to_load_issues', 'Problémy se nepodařilo načíst'), + (3, 3, 302, 'failed_to_load_quarters', 'Nepodařilo se načíst čtvrtletí'), + (3, 3, 302, 'failed_to_load_repositories', 'Nepodařilo se načíst repozitáře'), + (3, 3, 302, 'failed_to_load_years', 'Nepodařilo se načíst roky'), + (3, 3, 302, 'hours', 'Hodiny'), + (3, 3, 302, 'hours_spent', 'Strávené hodiny'), + (3, 3, 302, 'hours_worked', 'Odpracované hodiny'), + (3, 3, 302, 'issue_name', 'Název úkolu'), + (3, 3, 302, 'issues_for', 'úkoly pro'), + (3, 3, 302, 'loading', 'Načítání'), + (3, 3, 302, 'login_to_view_charts', 'Přihlaste se pro zobrazení grafů práce repozitářů.'), + (3, 3, 302, 'no_work_data_available', 'Pro zvolená kritéria nejsou k dispozici žádná pracovní data.'), + (3, 3, 302, 'quarter', 'Čtvrtletí'), + (3, 3, 302, 'repository', 'Repozitář'), + (3, 3, 302, 'repository_work_chart', 'Graf práce úložiště'), + (3, 3, 302, 'select_a_repository', 'Vyberte repozitář'), + (3, 3, 302, 'select_a_year', 'Vyberte rok'), + (3, 3, 302, 'select_quarter_to_view_issues', 'Vyberte prosím čtvrtletí pro zobrazení úkolů.'), + (3, 3, 302, 'select_repo_to_view_data', 'Vyberte prosím repozitář pro zobrazení pracovních dat.'), + (3, 3, 302, 'select_year_to_view_data', 'Vyberte prosím rok pro zobrazení pracovních dat.'), + (3, 3, 302, 'user_initials', 'Iniciály uživatele'), + (3, 3, 302, 'work_by_quarter', 'Práce dokončená po čtvrtletích (hodiny)'), + (3, 3, 302, 'work_done_by_quarter', 'práce provedená za čtvrtletí'), + (3, 3, 302, 'year', 'Rok'); -- Component: verify_email -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 3, 303, 'already_registered', 'Masz już konto?'), -(1, 3, 303, 'error_message', 'Nie udało nam się zweryfikować Twojego adresu e-mail.'), -(1, 3, 303, 'error_title', 'Weryfikacja nie powiodła się'), -(1, 3, 303, 'go_to_login', 'Przejdź do logowania'), -(1, 3, 303, 'invalid_token', 'Nieprawidłowy lub brakujący token weryfikacyjny'), -(1, 3, 303, 'please_wait', 'Masz już konto?'), -(1, 3, 303, 'redirect_message', 'Zostaniesz przekierowany na stronę logowania...'), -(1, 3, 303, 'success_message', 'Twój adres e-mail został pomyślnie zweryfikowany.'), -(1, 3, 303, 'success_title', 'E-mail zweryfikowany!'), -(1, 3, 303, 'verification_failed', 'Weryfikacja e-maila nie powiodła się'), -(1, 3, 303, 'verifying', 'Sprawdzanie Twojego adresu e-mail...'), -(2, 3, 303, 'already_registered', 'Already have an account?'), -(2, 3, 303, 'error_message', 'We could not verify your email.'), -(2, 3, 303, 'error_title', 'Verification Failed'), -(2, 3, 303, 'go_to_login', 'Go to Login'), -(2, 3, 303, 'invalid_token', 'Invalid or missing verification token'), -(2, 3, 303, 'please_wait', 'Already have an account?'), -(2, 3, 303, 'redirect_message', 'You will be redirected to login page...'), -(2, 3, 303, 'success_message', 'Your email has been verified successfully.'), -(2, 3, 303, 'success_title', 'Email Verified!'), -(2, 3, 303, 'verification_failed', 'Email verification failed'), -(2, 3, 303, 'verifying', 'Verifying your email...'), -(3, 3, 303, 'already_registered', 'Už máte účet?'), -(3, 3, 303, 'error_message', 'Nepodařilo se nám ověřit váš e-mail.'), -(3, 3, 303, 'error_title', 'Ověření selhalo'), -(3, 3, 303, 'go_to_login', 'Přejít na přihlášení'), -(3, 3, 303, 'invalid_token', 'Neplatný nebo chybějící ověřovací token'), -(3, 3, 303, 'please_wait', 'Už máte účet?'), -(3, 3, 303, 'redirect_message', 'Budete přesměrováni na přihlašovací stránku...'), -(3, 3, 303, 'success_message', 'Váš e-mail byl úspěšně ověřen.'), -(3, 3, 303, 'success_title', 'E-mail ověřen!'), -(3, 3, 303, 'verification_failed', 'Ověření e-mailu selhalo'), -(3, 3, 303, 'verifying', 'Ověřování vašeho e-mailu...') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_translations + (lang_id, scope_id, component_id, `key`, data) +VALUES + (1, 3, 303, 'already_registered', 'Masz już konto?'), + (1, 3, 303, 'error_message', 'Nie udało nam się zweryfikować Twojego adresu e-mail.'), + (1, 3, 303, 'error_title', 'Weryfikacja nie powiodła się'), + (1, 3, 303, 'go_to_login', 'Przejdź do logowania'), + (1, 3, 303, 'invalid_token', 'Nieprawidłowy lub brakujący token weryfikacyjny'), + (1, 3, 303, 'please_wait', 'Masz już konto?'), + (1, 3, 303, 'redirect_message', 'Zostaniesz przekierowany na stronę logowania...'), + (1, 3, 303, 'success_message', 'Twój adres e-mail został pomyślnie zweryfikowany.'), + (1, 3, 303, 'success_title', 'E-mail zweryfikowany!'), + (1, 3, 303, 'verification_failed', 'Weryfikacja e-maila nie powiodła się'), + (1, 3, 303, 'verifying', 'Sprawdzanie Twojego adresu e-mail...'), + (2, 3, 303, 'already_registered', 'already registered?'), + (2, 3, 303, 'error_message', 'We could not verify your email.'), + (2, 3, 303, 'error_title', 'Verification Failed'), + (2, 3, 303, 'go_to_login', 'Go to Login'), + (2, 3, 303, 'invalid_token', 'Invalid or missing verification token'), + (2, 3, 303, 'please_wait', 'Already have an account?'), + (2, 3, 303, 'redirect_message', 'You will be redirected to login page...'), + (2, 3, 303, 'success_message', 'Your email has been verified successfully.'), + (2, 3, 303, 'success_title', 'Email Verified!'), + (2, 3, 303, 'verification_failed', 'Email verification failed'), + (2, 3, 303, 'verifying', 'Verifying your email...'), + (3, 3, 303, 'already_registered', 'Už máte účet?'), + (3, 3, 303, 'error_message', 'Nepodařilo se nám ověřit váš e-mail.'), + (3, 3, 303, 'error_title', 'Ověření selhalo'), + (3, 3, 303, 'go_to_login', 'Přejít na přihlášení'), + (3, 3, 303, 'invalid_token', 'Neplatný nebo chybějící ověřovací token'), + (3, 3, 303, 'please_wait', 'Už máte účet?'), + (3, 3, 303, 'redirect_message', 'Budete přesměrováni na přihlašovací stránku...'), + (3, 3, 303, 'success_message', 'Váš e-mail byl úspěšně ověřen.'), + (3, 3, 303, 'success_title', 'E-mail ověřen!'), + (3, 3, 303, 'verification_failed', 'Ověření e-mailu selhalo'), + (3, 3, 303, 'verifying', 'Ověřování vašeho e-mailu...'); -- +goose Down -- Remove translations for this scope diff --git a/i18n/migrations/20260302163157_translations_backend.sql b/i18n/migrations/20260302163157_translations_backend.sql index 14e72c4..a6fec3e 100644 --- a/i18n/migrations/20260302163157_translations_backend.sql +++ b/i18n/migrations/20260302163157_translations_backend.sql @@ -2,26 +2,27 @@ -- Dump translations from database -- Components -INSERT INTO components (id, name) VALUES -(1, 'be'), -(2, 'login'), -(3, 'verify_email'), -(100, 'email'), -(101, 'error'), -(102, 'auth'), -(103, 'email'), -(300, 'general'), -(301, 'validate_error'), -(302, 'repo_chart'), -(303, 'verify_email') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_components (id, name) VALUES + (1, 'be'), + (2, 'login'), + (3, 'verify_email'), + (100, 'email'), + (101, 'error'), + (102, 'auth'), + (103, 'email'), + (300, 'general'), + (301, 'validate_error'), + (302, 'repo_chart'), + (303, 'verify_email'); -- Scope -INSERT INTO scopes (id, name) VALUES (1, 'Backend') ON CONFLICT DO NOTHING; +INSERT IGNORE INTO b2b_scopes (id, name) VALUES + (1, 'Backend'); -- Translations -- Component: be -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES +INSERT IGNORE INTO b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES (1, 1, 1, 'langs_loaded', NULL), (1, 1, 1, 'langs_not_loaded', NULL), (1, 1, 1, 'message_nok', NULL), @@ -39,10 +40,10 @@ INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES (3, 1, 1, 'message_nok', NULL), (3, 1, 1, 'message_ok', NULL), (3, 1, 1, 'translations_loaded', NULL), -(3, 1, 1, 'translations_not_loaded', NULL) ON CONFLICT DO NOTHING; +(3, 1, 1, 'translations_not_loaded', NULL); -- Component: email -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES +INSERT IGNORE INTO b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES (1, 1, 100, 'langs_loaded', NULL), (1, 1, 100, 'langs_not_loaded', NULL), (1, 1, 100, 'message_nok', NULL), @@ -60,10 +61,10 @@ INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES (3, 1, 100, 'message_nok', NULL), (3, 1, 100, 'message_ok', NULL), (3, 1, 100, 'translations_loaded', NULL), -(3, 1, 100, 'translations_not_loaded', NULL) ON CONFLICT DO NOTHING; +(3, 1, 100, 'translations_not_loaded', NULL); -- Component: error -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES +INSERT IGNORE INTO b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES (1, 1, 101, 'err_bad_paging', 'zła paginacja'), (1, 1, 101, 'err_bad_quarter_attribute', 'nieprawidłowy atrybut quarter'), (1, 1, 101, 'err_bad_repo_id_attribute', 'nieprawidłowy atrybut repoID'), @@ -144,10 +145,10 @@ INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES (3, 1, 101, 'err_token_required', 'je vyžadován token'), (3, 1, 101, 'err_user_inactive', 'uživatelský účet je neaktivní'), (3, 1, 101, 'err_user_not_found', 'uživatel nenalezen'), -(3, 1, 101, 'err_verification_token_expired', 'platnost ověřovacího tokenu vypršela') ON CONFLICT DO NOTHING; +(3, 1, 101, 'err_verification_token_expired', 'platnost ověřovacího tokenu vypršela'); -- Component: auth -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES +INSERT IGNORE INTO b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES (1, 1, 102, 'auth_if_account_exists', 'jeśli konto o tym adresie e-mail istnieje, został wysłany link do resetowania hasła'), (1, 1, 102, 'auth_logged_out_successfully', 'wylogowano pomyślnie'), (1, 1, 102, 'auth_password_reset_successfully', 'pomyślnie zresetowano hasło'), @@ -159,10 +160,10 @@ INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES (3, 1, 102, 'auth_if_account_exists', 'Pokud účet s danou e-mailovou adresou existuje, byl odeslán odkaz pro resetování hesla.'), (3, 1, 102, 'auth_logged_out_successfully', 'úspěšně odhlášen/a'), (3, 1, 102, 'auth_password_reset_successfully', 'úspěšné obnovení hesla'), -(3, 1, 102, 'auth_registration_successful', 'Registrace úspěšná, prosím ověřte svůj e-mail') ON CONFLICT DO NOTHING; +(3, 1, 102, 'auth_registration_successful', 'Registrace úspěšná, prosím ověřte svůj e-mail'); -- Component: email -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES +INSERT IGNORE INTO b2b_translations (lang_id, scope_id, component_id, `key`, data) VALUES (1, 1, 103, 'email_admin_notification_title', 'Admin notification title'), (1, 1, 103, 'email_footer', 'Wszelkie prawa zastrzeżone.'), (1, 1, 103, 'email_greeting', 'Witaj,'), @@ -213,7 +214,7 @@ INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES (3, 1, 103, 'email_verification_subject', 'Ověřte svou e-mailovou adresu'), (3, 1, 103, 'email_verification_title', 'Ověřte svou e-mailovou adresu'), (3, 1, 103, 'email_verify_button', 'Ověření e-mailové adresy'), -(3, 1, 103, 'email_warning_title', 'Důležité:') ON CONFLICT DO NOTHING; +(3, 1, 103, 'email_warning_title', 'Důležité:'); -- +goose Down -- Remove translations for this scope diff --git a/i18n/migrations/backend.sql b/i18n/migrations/backend.sql deleted file mode 100644 index 7ee1eea..0000000 --- a/i18n/migrations/backend.sql +++ /dev/null @@ -1,181 +0,0 @@ --- +goose Up --- Dump translations from database - --- Components -INSERT INTO components (id, name) VALUES -(1, 'be'), -(2, 'login'), -(3, 'verify_email'), -(100, 'email'), -(101, 'error'), -(102, 'auth'), -(103, 'email'), -(300, 'general') ON CONFLICT DO NOTHING; - --- Scope -INSERT INTO scopes (id, name) VALUES (1, 'Backend') ON CONFLICT DO NOTHING; - --- Translations - --- Component: email -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 1, 100, 'langs_loaded', NULL), -(1, 1, 100, 'langs_not_loaded', NULL), -(1, 1, 100, 'message_nok', NULL), -(1, 1, 100, 'message_ok', NULL), -(1, 1, 100, 'translations_loaded', NULL), -(1, 1, 100, 'translations_not_loaded', NULL), -(2, 1, 100, 'langs_loaded', NULL), -(2, 1, 100, 'langs_not_loaded', NULL), -(2, 1, 100, 'message_nok', NULL), -(2, 1, 100, 'message_ok', NULL), -(2, 1, 100, 'translations_loaded', NULL), -(2, 1, 100, 'translations_not_loaded', NULL), -(3, 1, 100, 'langs_loaded', NULL), -(3, 1, 100, 'langs_not_loaded', NULL), -(3, 1, 100, 'message_nok', NULL), -(3, 1, 100, 'message_ok', NULL), -(3, 1, 100, 'translations_loaded', NULL), -(3, 1, 100, 'translations_not_loaded', NULL) ON CONFLICT DO NOTHING; - --- Component: error -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 1, 101, 'err_email_exists', 'adres e-mail zajęty'), -(1, 1, 101, 'err_email_not_verified', 'adres e-mail nie został zweryfikowany'), -(1, 1, 101, 'err_email_password_required', 'wymagany jest adres e-mail i hasło'), -(1, 1, 101, 'err_email_required', 'Adres e-mail jest wymagany'), -(1, 1, 101, 'err_first_last_name_required', 'imię i nazwisko są wymagane'), -(1, 1, 101, 'err_internal_server_error', 'błąd wewnętrzny serwera'), -(1, 1, 101, 'err_invalid_body', 'nieprawidłowy tekst zapytania'), -(1, 1, 101, 'err_invalid_credentials', 'nieprawidłowy adres e-mail lub hasło'), -(1, 1, 101, 'err_invalid_password', 'hasło musi mieć co najmniej 10 znaków i zawierać co najmniej jedną małą literę, jedną wielką literę i jedną cyfrę'), -(1, 1, 101, 'err_invalid_reset_token', 'nieprawidłowy token'), -(1, 1, 101, 'err_invalid_token', 'nieprawidłowy token'), -(1, 1, 101, 'err_invalid_verification_token', 'nieprawidłowy token'), -(1, 1, 101, 'err_not_authenticated', 'nie uwierzytelniono'), -(1, 1, 101, 'err_passwords_do_not_match', 'hasła nie pasują'), -(1, 1, 101, 'err_refresh_token_required', 'wymagany jest token odświeżania'), -(1, 1, 101, 'err_reset_token_expired', 'token wygasł'), -(1, 1, 101, 'err_token_expired', 'token wygasł'), -(1, 1, 101, 'err_token_password_required', 'wymagane są token i hasło'), -(1, 1, 101, 'err_token_required', 'wymagany jest token'), -(1, 1, 101, 'err_user_inactive', 'konto użytkownika jest nieaktywne'), -(1, 1, 101, 'err_user_not_found', 'użytkownik nie został znaleziony'), -(1, 1, 101, 'err_verification_token_expired', 'token weryfikacyjny wygasł'), -(2, 1, 101, 'err_email_exists', 'email already exists'), -(2, 1, 101, 'err_email_not_verified', 'email not verified'), -(2, 1, 101, 'err_email_password_required', 'email and password are required'), -(2, 1, 101, 'err_email_required', 'email is required'), -(2, 1, 101, 'err_first_last_name_required', 'first and last name is required'), -(2, 1, 101, 'err_internal_server_error', 'internal server error'), -(2, 1, 101, 'err_invalid_body', 'invalid request body'), -(2, 1, 101, 'err_invalid_credentials', 'invalid email or password'), -(2, 1, 101, 'err_invalid_password', 'password must be at least 10 characters long and contain at least one lowercase letter, one uppercase letter, and one digit'), -(2, 1, 101, 'err_invalid_reset_token', 'invalid reset token'), -(2, 1, 101, 'err_invalid_token', 'invalid token'), -(2, 1, 101, 'err_invalid_verification_token', 'invalid verification token'), -(2, 1, 101, 'err_not_authenticated', 'not authenticated'), -(2, 1, 101, 'err_passwords_do_not_match', 'passwords do not match'), -(2, 1, 101, 'err_refresh_token_required', 'refresh token is required'), -(2, 1, 101, 'err_reset_token_expired', 'reset token has expired'), -(2, 1, 101, 'err_token_expired', 'token has expired'), -(2, 1, 101, 'err_token_password_required', 'token and password are required'), -(2, 1, 101, 'err_token_required', 'token is required'), -(2, 1, 101, 'err_user_inactive', 'user account is inactive'), -(2, 1, 101, 'err_user_not_found', 'user not found'), -(2, 1, 101, 'err_verification_token_expired', 'verification token has expired'), -(3, 1, 101, 'err_email_exists', 'e-mail již existuje'), -(3, 1, 101, 'err_email_not_verified', 'e-mail nebyl ověřen'), -(3, 1, 101, 'err_email_password_required', 'je vyžadován e-mail a heslo'), -(3, 1, 101, 'err_email_required', 'e-mail je povinný'), -(3, 1, 101, 'err_first_last_name_required', 'křestní jméno a příjmení je povinné'), -(3, 1, 101, 'err_internal_server_error', 'interní chyba serveru'), -(3, 1, 101, 'err_invalid_body', 'neplatné tělo požadavku'), -(3, 1, 101, 'err_invalid_credentials', 'neplatný e-mail nebo heslo'), -(3, 1, 101, 'err_invalid_password', 'heslo musí mít alespoň 10 znaků a musí obsahovat alespoň jedno malé písmeno, jedno velké písmeno a jednu číslici'), -(3, 1, 101, 'err_invalid_reset_token', 'neplatný resetovací token'), -(3, 1, 101, 'err_invalid_token', 'neplatný token'), -(3, 1, 101, 'err_invalid_verification_token', 'neplatný ověřovací token'), -(3, 1, 101, 'err_not_authenticated', 'neověřeno'), -(3, 1, 101, 'err_passwords_do_not_match', 'hesla se neshodují'), -(3, 1, 101, 'err_refresh_token_required', 'Je vyžadován token pro obnovení'), -(3, 1, 101, 'err_reset_token_expired', 'Platnost resetovacího tokenu vypršela'), -(3, 1, 101, 'err_token_expired', 'platnost tokenu vypršela'), -(3, 1, 101, 'err_token_password_required', 'je vyžadován token a heslo'), -(3, 1, 101, 'err_token_required', 'je vyžadován token'), -(3, 1, 101, 'err_user_inactive', 'uživatelský účet je neaktivní'), -(3, 1, 101, 'err_user_not_found', 'uživatel nenalezen'), -(3, 1, 101, 'err_verification_token_expired', 'platnost ověřovacího tokenu vypršela') ON CONFLICT DO NOTHING; - --- Component: auth -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 1, 102, 'auth_if_account_exists', 'jeśli konto o tym adresie e-mail istnieje, został wysłany link do resetowania hasła'), -(1, 1, 102, 'auth_logged_out_successfully', 'wylogowano pomyślnie'), -(1, 1, 102, 'auth_password_reset_successfully', 'pomyślnie zresetowano hasło'), -(1, 1, 102, 'auth_registration_successful', 'rejestracja pomyślna, proszę zweryfikować swój adres e-mail'), -(2, 1, 102, 'auth_if_account_exists', 'if an account with that email exists, a password reset link has been sent'), -(2, 1, 102, 'auth_logged_out_successfully', 'logged out successfully'), -(2, 1, 102, 'auth_password_reset_successfully', 'password reset successfully'), -(2, 1, 102, 'auth_registration_successful', 'registration successful, please verify your email'), -(3, 1, 102, 'auth_if_account_exists', 'Pokud účet s danou e-mailovou adresou existuje, byl odeslán odkaz pro resetování hesla.'), -(3, 1, 102, 'auth_logged_out_successfully', 'úspěšně odhlášen/a'), -(3, 1, 102, 'auth_password_reset_successfully', 'úspěšné obnovení hesla'), -(3, 1, 102, 'auth_registration_successful', 'Registrace úspěšná, prosím ověřte svůj e-mail') ON CONFLICT DO NOTHING; - --- Component: email -INSERT INTO translations (lang_id, scope_id, component_id, "key", data) VALUES -(1, 1, 103, 'email_admin_notification_title', 'Admin notification title'), -(1, 1, 103, 'email_footer', 'Wszelkie prawa zastrzeżone.'), -(1, 1, 103, 'email_greeting', 'Witaj,'), -(1, 1, 103, 'email_ignore', 'Jeśli nie jesteś właścicielem tego konta, prosimy o zignorowanie maila.'), -(1, 1, 103, 'email_ignore_reset', 'Jeśli nie chcesz zmieniać hasła, prosimy o zignorowanie maila. Twoje hasło pozostanie niezmienione.'), -(1, 1, 103, 'email_or_copy', 'Bądź przekopiuj poniższy link do przeglądarki:'), -(1, 1, 103, 'email_password_reset_message1', 'Otrzymaliśmy prośbę o zresetowanie Twojego hasła. Aby utworzyć nowe hasło, kliknij w poniższy przycisk:'), -(1, 1, 103, 'email_password_reset_subject', 'Zresetuj hasło'), -(1, 1, 103, 'email_password_reset_title', 'Zresetuj swoje hasło'), -(1, 1, 103, 'email_password_reset_warning', 'Link na zresesetowanie hasła przedawni się po 1 godzinie.'), -(1, 1, 103, 'email_reset_button', 'Zresetuj hasło'), -(1, 1, 103, 'email_verification_message1', 'Dziękujemy za rejestrację. Aby dokończyć proces rejestracji, zweryfikuj swojego maila klikając w poniższy link:'), -(1, 1, 103, 'email_verification_note', 'Uwaga: link weryfikacyjny przedawni się za 24 godziny.'), -(1, 1, 103, 'email_verification_subject', 'Zweryfikuj swój adres email'), -(1, 1, 103, 'email_verification_title', 'Weryfikacja Adresu email'), -(1, 1, 103, 'email_verify_button', 'Zweryfikuj adres email'), -(1, 1, 103, 'email_warning_title', 'Ważne:'), -(2, 1, 103, 'email_admin_notification_title', 'Admin notification title'), -(2, 1, 103, 'email_footer', 'All rights reserved.'), -(2, 1, 103, 'email_greeting', 'Hello,'), -(2, 1, 103, 'email_ignore', 'If you did not create an account with us, please ignore this email.'), -(2, 1, 103, 'email_ignore_reset', 'If you did not request a password reset, please ignore this email. Your password will remain unchanged.'), -(2, 1, 103, 'email_or_copy', 'Or copy and paste this link into your browser:'), -(2, 1, 103, 'email_password_reset_message1', 'We received a request to reset your password. Click the button below to create a new password:'), -(2, 1, 103, 'email_password_reset_subject', 'Reset Your Password'), -(2, 1, 103, 'email_password_reset_title', 'Reset Your Password'), -(2, 1, 103, 'email_password_reset_warning', 'This password reset link will expire in 1 hour for security reasons.'), -(2, 1, 103, 'email_reset_button', 'Reset Password'), -(2, 1, 103, 'email_verification_message1', 'Thank you for registering with us. To complete your registration and activate your account, please verify your email address by clicking the button below:'), -(2, 1, 103, 'email_verification_note', 'Note: This verification link will expire in 24 hours.'), -(2, 1, 103, 'email_verification_subject', 'Verify Your Email Address'), -(2, 1, 103, 'email_verification_title', 'Verify Your Email Address'), -(2, 1, 103, 'email_verify_button', 'Verify Email Address'), -(2, 1, 103, 'email_warning_title', 'Important:'), -(3, 1, 103, 'email_admin_notification_title', 'Admin notification title'), -(3, 1, 103, 'email_footer', 'Všechna práva vyhrazena.'), -(3, 1, 103, 'email_greeting', 'Ahoj,'), -(3, 1, 103, 'email_ignore', 'Pokud jste si u nás nevytvořili účet, prosím, ignorujte tento e-mail.'), -(3, 1, 103, 'email_ignore_reset', 'Pokud jste nepožádali o obnovení hesla, ignorujte prosím tento e-mail. Vaše heslo zůstane nezměněno.'), -(3, 1, 103, 'email_or_copy', 'Nebo zkopírujte a vložte tento odkaz do prohlížeče:'), -(3, 1, 103, 'email_password_reset_message1', 'Obdrželi jsme žádost o obnovení hesla. Klikněte na tlačítko níže a vytvořte si nové heslo:'), -(3, 1, 103, 'email_password_reset_subject', 'Obnovte si heslo'), -(3, 1, 103, 'email_password_reset_title', 'Obnovte si heslo'), -(3, 1, 103, 'email_password_reset_warning', 'Z bezpečnostních důvodů platnost tohoto odkazu pro obnovení hesla vyprší za 1 hodinu.'), -(3, 1, 103, 'email_reset_button', 'Obnovit heslo'), -(3, 1, 103, 'email_verification_message1', 'Děkujeme za registraci u nás. Chcete-li dokončit registraci a aktivovat svůj účet, ověřte prosím svou e-mailovou adresu kliknutím na tlačítko níže:'), -(3, 1, 103, 'email_verification_note', 'Poznámka: Platnost tohoto ověřovacího odkazu vyprší za 24 hodin.'), -(3, 1, 103, 'email_verification_subject', 'Ověřte svou e-mailovou adresu'), -(3, 1, 103, 'email_verification_title', 'Ověřte svou e-mailovou adresu'), -(3, 1, 103, 'email_verify_button', 'Ověření e-mailové adresy'), -(3, 1, 103, 'email_warning_title', 'Důležité:') ON CONFLICT DO NOTHING; - --- +goose Down --- Remove translations for this scope -DELETE FROM translations WHERE scope_id = 1; diff --git a/taskfiles/db.yml b/taskfiles/db.yml index 84295b9..b7a349b 100644 --- a/taskfiles/db.yml +++ b/taskfiles/db.yml @@ -1,41 +1,65 @@ version: "3" +vars: + PROJECT: nalu_b2b + BUILD_DIR: ./bin + + REMOTE_USER: root + REMOTE_HOST: dc02-de + EMAIL_SMTP_PORT: 1025 + EMAIL_SMTP_HOST: localhost + + LOCAL_DB_SERVICE: db + LOCAL_DB_USER: nalu + LOCAL_DB_NAME: nalu + LOCAL_DB_PASSWORD: Maal12345678 + DUMP_FILE_NAME: + sh: echo nalu_$(date +%Y_%m_%d__%H_%M_%S).sql + REMOTE_DB_SERVICE: "www_naluconcept_com_nalu_db" + REMOTE_DB_NAME: "presta" + REMOTE_DB_USER: "presta" + REMOTE_DB_PASS: "presta" + tasks: reset: desc: Drop and recreate database cmds: - - | - docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d postgres -c \ - \"SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='{{.DB_NAME}}' AND pid<>pg_backend_pid();\"" - - | - docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d postgres -c \"DROP DATABASE IF EXISTS {{.DB_NAME}};\"" - - | - docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d postgres -c \"CREATE DATABASE {{.DB_NAME}};\"" + - > + docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} + -e 'DROP DATABASE IF EXISTS {{.LOCAL_DB_NAME}}; CREATE DATABASE IF NOT EXISTS {{.LOCAL_DB_NAME}};' restore: desc: Restore DB from file aliases: [r] + silent: true preconditions: - sh: '[ -n "{{index .CLI_ARGS_LIST 0}}" ]' msg: "Usage: task db:restore -- dump.sql" cmds: - task db:reset - | - cat {{index .CLI_ARGS_LIST 0}} | docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d {{.DB_NAME}}" - - task db:migrate + {{if eq (len .CLI_ARGS_LIST) 0}} + echo "Error: No file path provided." + exit 1 + {{else}} + cat {{index .CLI_ARGS_LIST 0}} | docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb \ + -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} \ + {{.LOCAL_DB_NAME}} + {{end}} + - task db:mal - migrate: - desc: Apply SQL migrations - aliases: [m] + migrations_apply_localy: + aliases: [mal] + desc: Apply Migrations to local database + silent: true cmds: - - | - sed '/-- +goose Down/,$d' i18n/migrations/20260302163100_routes.sql | docker compose -p {{.PROJECT}} exec -T -e PGPASSWORD={{.DB_PASSWORD}} {{.DB_SERVICE_NAME}} psql -U {{.DB_USER}} -d {{.DB_NAME}} - sed '/-- +goose Down/,$d' i18n/migrations/20260302163122_create_tables.sql | docker compose -p {{.PROJECT}} exec -T -e PGPASSWORD={{.DB_PASSWORD}} {{.DB_SERVICE_NAME}} psql -U {{.DB_USER}} -d {{.DB_NAME}} - sed '/-- +goose Down/,$d' i18n/migrations/20260302163152_translations_backoffice.sql | docker compose -p {{.PROJECT}} exec -T -e PGPASSWORD={{.DB_PASSWORD}} {{.DB_SERVICE_NAME}} psql -U {{.DB_USER}} -d {{.DB_NAME}} - sed '/-- +goose Down/,$d' i18n/migrations/20260302163157_translations_backend.sql | docker compose -p {{.PROJECT}} exec -T -e PGPASSWORD={{.DB_PASSWORD}} {{.DB_SERVICE_NAME}} psql -U {{.DB_USER}} -d {{.DB_NAME}} - + - | + sed '/-- +goose Down/,$d' i18n/migrations/20260302163100_routes.sql | docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} {{.LOCAL_DB_NAME}} + sed '/-- +goose Down/,$d' i18n/migrations/20260302163122_create_tables.sql | docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} {{.LOCAL_DB_NAME}} + sed '/-- +goose Down/,$d' i18n/migrations/20260302163152_translations_backoffice.sql | docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} {{.LOCAL_DB_NAME}} + sed '/-- +goose Down/,$d' i18n/migrations/20260302163157_translations_backend.sql | docker compose -p {{.PROJECT}} exec -T {{.LOCAL_DB_SERVICE}} mariadb -u {{.LOCAL_DB_USER}} --password={{.LOCAL_DB_PASSWORD}} {{.LOCAL_DB_NAME}} \ No newline at end of file diff --git a/taskfiles/gitea.yml b/taskfiles/gitea.yml deleted file mode 100644 index 6aa780a..0000000 --- a/taskfiles/gitea.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: "3" - -tasks: - - pull: - desc: Pull remote Gitea DB into local DB - aliases: [gp] - silent: true - cmds: - - task db:reset - - | - ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ - "docker exec {{.GITEA_SERVICE}} pg_dump -U {{.GITEA_USER}} {{.GITEA_DB}}" | docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d {{.DB_NAME}}" - - - dump: - desc: Dump remote Gitea DB to file - aliases: [gd] - silent: true - cmds: - - | - ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "docker exec {{.GITEA_SERVICE}} pg_dump -U {{.GITEA_USER}} {{.GITEA_DB}}" > {{.DUMP_FILE_NAME}} - - - gitea_pull_db_to_file_ma_al_pl: - desc: Pull remote Gitea DB and upload to file.ma-al.pl - aliases: [rdbtfmpl] - silent: true - vars: - SERVER: https://file.ma-al.pl - TARGET_DIR: maal_internal/timetracker/dumps - TMP_DIR: /tmp - TOKEN: - sh: | - curl -s -u "{{.FILE_MAAL_PL_USER}}:{{.FILE_MAAL_PL_PASSWORD}}" "{{.SERVER}}/api/v2/user/token" | jq -r .access_token - preconditions: - - sh: '[ -n "{{.FILE_MAAL_PL_USER}}" ]' - msg: "Missing FILE_MAAL_PL_USER in .env" - - sh: '[ -n "{{.FILE_MAAL_PL_PASSWORD}}" ]' - msg: "Missing FILE_MAAL_PL_PASSWORD in .env" - cmds: - - | - ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "docker exec {{.GITEA_REMOTE_SERVICE}} pg_dump -U {{.GITEA_REMOTE_DB_USER}} {{.GITEA_REMOTE_DB_NAME}}" > {{.TMP_DIR}}/{{.DUMP_FILE_NAME}} - - > - curl -X POST "{{.SERVER}}/api/v2/user/files/upload?path={{.TARGET_DIR}}/{{.DUMP_FILE_NAME}}&mkdir_parents=true" -H "Authorization: Bearer {{.TOKEN}}" -H "Content-Type: application/x-tar" --data-binary "@{{.TMP_DIR}}/{{.DUMP_FILE_NAME}}" - - | - rm -f {{.TMP_DIR}}/{{.DUMP_FILE_NAME}} \ No newline at end of file diff --git a/taskfiles/nalu_db.yml b/taskfiles/nalu_db.yml new file mode 100644 index 0000000..4c82b4c --- /dev/null +++ b/taskfiles/nalu_db.yml @@ -0,0 +1,65 @@ +version: "3" + +tasks: + + pull: + desc: Pull remote Gitea DB into local DB + aliases: [gp] + silent: true + cmds: + - task db:reset + - | + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} \ + "docker exec {{.GITEA_SERVICE}} pg_dump -U {{.GITEA_USER}} {{.GITEA_DB}}" | docker compose -p {{.PROJECT}} exec -T {{.DB_SERVICE_NAME}} sh -c "PGPASSWORD='{{.DB_PASSWORD}}' psql -U {{.DB_USER}} -d {{.DB_NAME}}" + + + dump: + desc: Dump remote Gitea DB to file + aliases: [dump] + # silent: true + vars: + TEMP_DB_NAME: "temp_db_copy" + SERVER: https://file.ma-al.pl + TARGET_DIR: /maal_internal/nalu_b2b/dumps + TMP_DIR: /tmp + REMOTE_DB_USER: root + REMOTE_DB_PASS: Maal12345678 + TOKEN: + sh: curl -s -X GET {{.SERVER}}/api/v2/user/token -u "{{.FILE_MAAL_PL_USER}}:{{.FILE_MAAL_PL_PASSWORD}}" | jq -r .access_token + cmds: + - > + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "docker exec \$(docker ps -q -f name={{.REMOTE_DB_SERVICE}}) mariadb -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} -e 'CREATE DATABASE IF NOT EXISTS {{.TEMP_DB_NAME}}'" + - > + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} + "docker exec \$(docker ps -q -f name={{.REMOTE_DB_SERVICE}}) bash -c \"mariadb-dump --routines --events --triggers -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} {{.REMOTE_DB_NAME}} | sed 's/DEFINER[ ]*=[ ]*[^ ]*//' | mariadb -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} {{.TEMP_DB_NAME}}\"" + - > + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} + "docker exec \$(docker ps -q -f name={{.REMOTE_DB_SERVICE}}) mariadb -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} {{.TEMP_DB_NAME}} -e \" + UPDATE IGNORE ps_customer SET email = REGEXP_REPLACE(email, '@.*$', '@ma-al.com'); + UPDATE ps_configuration SET value = '${HOST_TO_SERVE}' WHERE name = 'PS_SHOP_DOMAIN'; + UPDATE ps_configuration SET value = '${HOST_TO_SERVE}' WHERE name = 'PS_SHOP_DOMAIN_SSL'; + UPDATE ps_configuration SET value = '${USE_SSL:-1}' WHERE name = 'PS_SSL_ENABLED'; + UPDATE ps_configuration SET value = '1' WHERE name = 'PS_SSL_ENABLED_EVERYWHERE'; + UPDATE ps_configuration SET value = '2' WHERE name = 'PS_MAIL_METHOD'; + UPDATE ps_configuration SET value = 'admin@ma-al.com' WHERE name = 'PS_SHOP_EMAIL'; + UPDATE ps_configuration SET value = 'maildev' WHERE name = 'PS_MAIL_SERVER'; + UPDATE ps_configuration SET value = '' WHERE name = 'PS_MAIL_USER'; + UPDATE ps_configuration SET value = '' WHERE name = 'PS_MAIL_PASSWD'; + UPDATE ps_configuration SET value = 'off' WHERE name = 'PS_MAIL_SMTP_ENCRYPTION'; + UPDATE ps_configuration SET value = '1025' WHERE name = 'PS_MAIL_SMTP_PORT'; + UPDATE ps_configuration SET value = 'admin@ma-al.com' WHERE name = 'MA_MERCHANT_MAILS'; + UPDATE ps_shop_url SET domain = '${HOST_TO_SERVE}', domain_ssl = '${HOST_TO_SERVE}' WHERE id_shop_url = '1'; + UPDATE ps_configuration SET value='0' WHERE (ps_configuration.name = 'PS_SMARTY_CACHE'); + UPDATE ps_configuration SET value='0' WHERE (ps_configuration.name = 'PS_CSS_THEME_CACHE'); + UPDATE ps_configuration SET value='0' WHERE (ps_configuration.name = 'PS_JS_THEME_CACHE'); + \"" + - > + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} + "docker exec \$(docker ps -q -f name={{.REMOTE_DB_SERVICE}}) mariadb-dump --routines --events --triggers -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} {{.TEMP_DB_NAME}}" > {{.TMP_DIR}}/{{.DUMP_FILE_NAME}} + - sed -i 's/DEFINER[ ]*=[ ]*[^ ]*//' {{.TMP_DIR}}/{{.DUMP_FILE_NAME}} + - > + curl -X POST "{{.SERVER}}/api/v2/user/files/upload?path={{.TARGET_DIR}}/{{.DUMP_FILE_NAME}}&mkdir_parents=true" -H "Authorization: Bearer {{.TOKEN}}" -H "Content-Type: application/x-tar" --data-binary "@{{.TMP_DIR}}/{{.DUMP_FILE_NAME}}" + - rm -rf {{.TMP_DIR}}/{{.DUMP_FILE_NAME}} + - > + ssh {{.REMOTE_USER}}@{{.REMOTE_HOST}} "docker exec \$(docker ps -q -f name={{.REMOTE_DB_SERVICE}}) mariadb -u {{.REMOTE_DB_USER}} --password={{.REMOTE_DB_PASS}} -e 'DROP DATABASE IF EXISTS {{.TEMP_DB_NAME}}'" +