From dce2a57f3cc3b7e8939f5b497603806194337d6a Mon Sep 17 00:00:00 2001 From: gdarko Date: Sun, 28 Jan 2024 15:07:09 -0600 Subject: [PATCH 01/11] Replace old references --- .env.example | 12 ++++++------ .env.testing | 2 +- composer.lock | 2 +- config/invoiceshelf.php | 2 +- config/mail.php | 2 +- database/seeders/UsersTableSeeder.php | 4 ++-- docker-compose.yml | 22 +++++++++++----------- phpunit.xml | 2 +- readme.md | 2 +- routes/api.php | 2 +- tests/Feature/Admin/CompanySettingTest.php | 4 ++-- uffizzi/.env.example | 12 ++++++------ uffizzi/Dockerfile | 20 ++++++++++---------- uffizzi/crond/Dockerfile | 12 ++++++------ uffizzi/docker-compose.uffizzi.yml | 18 +++++++++--------- 15 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.env.example b/.env.example index c8d4e223..b540b9be 100644 --- a/.env.example +++ b/.env.example @@ -2,14 +2,14 @@ APP_ENV=production APP_KEY=base64:kgk/4DW1vEVy7aEvet5FPp5un6PIGe/so8H0mvoUtW0= APP_DEBUG=true APP_LOG_LEVEL=debug -APP_URL=http://crater.test +APP_URL=http://invoiceshelf.test DB_CONNECTION=mysql DB_HOST=db DB_PORT=3306 -DB_DATABASE=crater -DB_USERNAME=crater -DB_PASSWORD="crater" +DB_DATABASE=invoiceshelf +DB_USERNAME=invoiceshelf +DB_PASSWORD="invoiceshelf" BROADCAST_DRIVER=log CACHE_DRIVER=file @@ -32,8 +32,8 @@ PUSHER_APP_ID= PUSHER_KEY= PUSHER_SECRET= -SANCTUM_STATEFUL_DOMAINS=crater.test -SESSION_DOMAIN=crater.test +SANCTUM_STATEFUL_DOMAINS=invoiceshelf.test +SESSION_DOMAIN=invoiceshelf.test TRUSTED_PROXIES="*" diff --git a/.env.testing b/.env.testing index d5e8caba..4fd02cf3 100644 --- a/.env.testing +++ b/.env.testing @@ -9,5 +9,5 @@ MAIL_PORT=587 MAIL_USERNAME=ff538f0e1037f4 MAIL_PASSWORD=c04c81145fcb73 MAIL_ENCRYPTION=tls -MAIL_FROM_ADDRESS="admin@craterapp.com" +MAIL_FROM_ADDRESS="admin@invoiceshelf.com" MAIL_FROM_NAME="John Doe" diff --git a/composer.lock b/composer.lock index 6386f2a3..641b40bb 100644 --- a/composer.lock +++ b/composer.lock @@ -1727,7 +1727,7 @@ ], "description": "Crater Module Management Package", "keywords": [ - "crater", + "invoiceshelf", "laravel", "module", "modules", diff --git a/config/invoiceshelf.php b/config/invoiceshelf.php index be63d18a..6a13ff4a 100644 --- a/config/invoiceshelf.php +++ b/config/invoiceshelf.php @@ -46,7 +46,7 @@ return [ /* * Marketplace url. */ - 'base_url' => 'https://craterapp.com', + 'base_url' => 'https://invoiceshelf.com', /* * List of languages supported by Crater. diff --git a/config/mail.php b/config/mail.php index 9f1ff07e..094f5ad4 100644 --- a/config/mail.php +++ b/config/mail.php @@ -56,7 +56,7 @@ return [ */ 'from' => [ - 'address' => env('MAIL_FROM_ADDRESS', 'admin@crater.in'), + 'address' => env('MAIL_FROM_ADDRESS', 'admin@invoiceshelf.com'), 'name' => env('MAIL_FROM_NAME', 'Crater'), ], diff --git a/database/seeders/UsersTableSeeder.php b/database/seeders/UsersTableSeeder.php index 23157850..a4712b16 100644 --- a/database/seeders/UsersTableSeeder.php +++ b/database/seeders/UsersTableSeeder.php @@ -19,10 +19,10 @@ class UsersTableSeeder extends Seeder public function run() { $user = User::create([ - 'email' => 'admin@craterapp.com', + 'email' => 'admin@invoiceshelf.com', 'name' => 'Jane Doe', 'role' => 'super admin', - 'password' => 'crater@123', + 'password' => 'invoiceshelf@123', ]); $company = Company::create([ diff --git a/docker-compose.yml b/docker-compose.yml index 0c7cdc20..54e6f35c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,18 +4,18 @@ services: app: build: args: - user: crater-user + user: invoiceshelf-user uid: 1000 context: ./ dockerfile: Dockerfile - image: crater-php + image: invoiceshelf-php restart: unless-stopped working_dir: /var/www/ volumes: - ./:/var/www - ./docker-compose/php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw,delegated networks: - - crater + - invoiceshelf db: image: mariadb @@ -26,14 +26,14 @@ services: # and uncomment the line under this one. #- ./docker-compose/db/data:/var/lib/mysql:rw,delegated environment: - MYSQL_USER: crater - MYSQL_PASSWORD: crater - MYSQL_DATABASE: crater - MYSQL_ROOT_PASSWORD: crater + MYSQL_USER: invoiceshelf + MYSQL_PASSWORD: invoiceshelf + MYSQL_DATABASE: invoiceshelf + MYSQL_ROOT_PASSWORD: invoiceshelf ports: - '33006:3306' networks: - - crater + - invoiceshelf nginx: image: nginx:1.17-alpine @@ -44,7 +44,7 @@ services: - ./:/var/www - ./docker-compose/nginx:/etc/nginx/conf.d/ networks: - - crater + - invoiceshelf cron: build: @@ -53,11 +53,11 @@ services: volumes: - ./:/var/www networks: - - crater + - invoiceshelf volumes: db: networks: - crater: + invoiceshelf: driver: bridge diff --git a/phpunit.xml b/phpunit.xml index 2ae23513..21e03a9d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -25,6 +25,6 @@ - + diff --git a/readme.md b/readme.md index 312125ba..f76fa6a7 100644 --- a/readme.md +++ b/readme.md @@ -87,7 +87,7 @@ Join the Crater discord server to discuss: ## Translate -Help us translate on https://crowdin.com/project/crater-invoice +Help us translate on https://crowdin.com/project/invoiceshelf **Thanks to Translation Contributors:** diff --git a/routes/api.php b/routes/api.php index 8b002409..f3782cb8 100644 --- a/routes/api.php +++ b/routes/api.php @@ -124,7 +124,7 @@ use Illuminate\Support\Facades\Route; Route::get('ping', function () { return response()->json([ - 'success' => 'crater-self-hosted', + 'success' => 'invoiceshelf-self-hosted', ]); })->name('ping'); diff --git a/tests/Feature/Admin/CompanySettingTest.php b/tests/Feature/Admin/CompanySettingTest.php index b5e29c3f..948d6c6f 100644 --- a/tests/Feature/Admin/CompanySettingTest.php +++ b/tests/Feature/Admin/CompanySettingTest.php @@ -45,7 +45,7 @@ test('update profile', function () { $user = [ 'name' => 'John Doe', 'password' => 'admin@123', - 'email' => 'admin@crater.in', + 'email' => 'admin@invoiceshelf.com', ]; $response = putJson('api/v1/me', $user); @@ -101,7 +101,7 @@ test('update settings', function () { 'fiscal_year' => '1-12', 'carbon_date_format' => 'Y/m/d', 'moment_date_format' => 'YYYY/MM/DD', - 'notification_email' => 'noreply@crater.in', + 'notification_email' => 'noreply@invoiceshelf.com', 'notify_invoice_viewed' => 'YES', 'notify_estimate_viewed' => 'YES', 'tax_per_item' => 'YES', diff --git a/uffizzi/.env.example b/uffizzi/.env.example index 3b52a3db..d3492100 100644 --- a/uffizzi/.env.example +++ b/uffizzi/.env.example @@ -2,14 +2,14 @@ APP_ENV=production APP_KEY=base64:kgk/4DW1vEVy7aEvet5FPp5un6PIGe/so8H0mvoUtW0= APP_DEBUG=true APP_LOG_LEVEL=debug -APP_URL=http://crater.test +APP_URL=http://invoiceshelf.test DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 -DB_DATABASE=crater -DB_USERNAME=crater -DB_PASSWORD=crater +DB_DATABASE=invoiceshelf +DB_USERNAME=invoiceshelf +DB_PASSWORD=invoiceshelf BROADCAST_DRIVER=log CACHE_DRIVER=file @@ -32,8 +32,8 @@ PUSHER_APP_ID= PUSHER_KEY= PUSHER_SECRET= -SANCTUM_STATEFUL_DOMAINS=crater.test -SESSION_DOMAIN=crater.test +SANCTUM_STATEFUL_DOMAINS=invoiceshelf.test +SESSION_DOMAIN=invoiceshelf.test TRUSTED_PROXIES="*" diff --git a/uffizzi/Dockerfile b/uffizzi/Dockerfile index b78fdb10..19e15053 100644 --- a/uffizzi/Dockerfile +++ b/uffizzi/Dockerfile @@ -27,9 +27,9 @@ RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Create system user to run Composer and Artisan Commands -RUN useradd -G www-data,root -u 1000 -d /home/crater-user crater-user -RUN mkdir -p /home/crater-user/.composer && \ - chown -R crater-user:crater-user /home/crater-user +RUN useradd -G www-data,root -u 1000 -d /home/invoiceshelf-user invoiceshelf-user +RUN mkdir -p /home/invoiceshelf-user/.composer && \ + chown -R invoiceshelf-user:invoiceshelf-user /home/invoiceshelf-user # Mounted volumes COPY ./ /var/www @@ -39,10 +39,10 @@ COPY ./uffizzi/.env.example /var/www/.env # Set working directory WORKDIR /var/www -RUN chown -R crater-user:crater-user ./ -RUN chmod -R 775 composer.json composer.lock \ +RUN chown -R invoiceshelf-user:invoiceshelf-user ./ +RUN chmod -R 775 composer.json composer.lock \ composer.lock storage/framework/ \ - storage/logs/ bootstrap/cache/ /home/crater-user/.composer + storage/logs/ bootstrap/cache/ /home/invoiceshelf-user/.composer RUN chown -R $(whoami):$(whoami) /var/log/ RUN chmod -R 775 /var/log @@ -52,13 +52,13 @@ RUN npm config set user 0 RUN npm config set unsafe-perm true # Frontend bulding RUN sed -i 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/g' /var/www/.env -RUN sed -i 's/DB_DATABASE=crater/DB_DATABASE=\/tmp\/crater.sqlite/g' /var/www/.env -RUN touch /tmp/crater.sqlite +RUN sed -i 's/DB_DATABASE=invoiceshelf/DB_DATABASE=\/tmp\/invoiceshelf.sqlite/g' /var/www/.env +RUN touch /tmp/invoiceshelf.sqlite RUN composer install --no-interaction --prefer-dist RUN npm i -f RUN npm install --save-dev sass RUN export NODE_OPTIONS="--max-old-space-size=4096" && /usr/bin/npx vite build --target=es2020 RUN sed -i 's/DB_CONNECTION=sqlite/DB_CONNECTION=mysql/g' /var/www/.env -RUN sed -i 's/DB_DATABASE=\/tmp\/crater.sqlite/DB_DATABASE=crater/g' /var/www/.env +RUN sed -i 's/DB_DATABASE=\/tmp\/invoiceshelf.sqlite/DB_DATABASE=invoiceshelf/g' /var/www/.env -USER crater-user +USER invoiceshelf-user diff --git a/uffizzi/crond/Dockerfile b/uffizzi/crond/Dockerfile index 3fb5567c..9b850bfd 100644 --- a/uffizzi/crond/Dockerfile +++ b/uffizzi/crond/Dockerfile @@ -26,9 +26,9 @@ RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl bcmath gd COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # Create system user to run Composer and Artisan Commands -RUN useradd -G www-data,root -u 1000 -d /home/crater-user crater-user -RUN mkdir -p /home/crater-user/.composer && \ - chown -R crater-user:crater-user /home/crater-user +RUN useradd -G www-data,root -u 1000 -d /home/invoiceshelf-user invoiceshelf-user +RUN mkdir -p /home/invoiceshelf-user/.composer && \ + chown -R invoiceshelf-user:invoiceshelf-user /home/invoiceshelf-user # Mounted volumes COPY ./ /var/www @@ -38,10 +38,10 @@ COPY ./uffizzi/.env.example /var/www/.env # Set working directory WORKDIR /var/www -RUN chown -R crater-user:crater-user ./ -RUN chmod -R 775 composer.json composer.lock \ +RUN chown -R invoiceshelf-user:invoiceshelf-user ./ +RUN chmod -R 775 composer.json composer.lock \ composer.lock storage/framework/ \ - storage/logs/ bootstrap/cache/ /home/crater-user/.composer + storage/logs/ bootstrap/cache/ /home/invoiceshelf-user/.composer RUN composer config --no-plugins allow-plugins.pestphp/pest-plugin true && \ composer install --no-interaction --prefer-dist --optimize-autoloader && \ diff --git a/uffizzi/docker-compose.uffizzi.yml b/uffizzi/docker-compose.uffizzi.yml index e1dd79c8..fe5c79ed 100644 --- a/uffizzi/docker-compose.uffizzi.yml +++ b/uffizzi/docker-compose.uffizzi.yml @@ -11,10 +11,10 @@ services: restart: unless-stopped working_dir: /var/www/ command: ["-c"," - composer config --no-plugins allow-plugins.pestphp/pest-plugin true && - composer install --no-interaction --prefer-dist --optimize-autoloader && - php artisan storage:link || true && - php artisan key:generate --force && + composer config --no-plugins allow-plugins.pestphp/pest-plugin true && + composer install --no-interaction --prefer-dist --optimize-autoloader && + php artisan storage:link || true && + php artisan key:generate --force && php-fpm", ] entrypoint: /bin/sh @@ -29,10 +29,10 @@ services: image: mariadb restart: always environment: - MYSQL_USER: crater - MYSQL_PASSWORD: crater - MYSQL_DATABASE: crater - MYSQL_ROOT_PASSWORD: crater + MYSQL_USER: invoiceshelf + MYSQL_PASSWORD: invoiceshelf + MYSQL_DATABASE: invoiceshelf + MYSQL_ROOT_PASSWORD: invoiceshelf ports: - '33006:3306' deploy: @@ -54,5 +54,5 @@ services: cron: image: "${CROND_IMAGE}" restart: always - + From e43ddeea546f3343d9ffc2888f49577dfd3b08f0 Mon Sep 17 00:00:00 2001 From: gdarko Date: Sun, 28 Jan 2024 15:11:58 -0600 Subject: [PATCH 02/11] Fix wrong rollback in add_overdue_to_invoices_table migration --- .../2022_03_02_120210_add_overdue_to_invoices_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2022_03_02_120210_add_overdue_to_invoices_table.php b/database/migrations/2022_03_02_120210_add_overdue_to_invoices_table.php index e8572b2e..d43f6c0d 100644 --- a/database/migrations/2022_03_02_120210_add_overdue_to_invoices_table.php +++ b/database/migrations/2022_03_02_120210_add_overdue_to_invoices_table.php @@ -26,7 +26,7 @@ class AddOverdueToInvoicesTable extends Migration public function down() { Schema::table('invoices', function (Blueprint $table) { - $table->dropForeign(['overdue']); + $table->dropColumn(['overdue']); }); } } From fdb46275c0472017d166421024a77df2a967a569 Mon Sep 17 00:00:00 2001 From: gdarko Date: Sat, 6 Nov 2021 14:22:59 -0500 Subject: [PATCH 03/11] Fix database migration rollback --- .../2020_02_01_063235_create_custom_fields_table.php | 5 +++++ ...2020_02_01_063509_create_custom_field_values_table.php | 8 +++++++- .../2020_05_12_154129_add_user_id_to_expenses_table.php | 4 +--- .../2020_10_01_102913_add_company_to_addresses_table.php | 4 +++- .../2020_11_23_050206_add_creator_in_invoices_table.php | 4 +++- .../2020_11_23_050252_add_creator_in_estimates_table.php | 4 +++- .../2020_11_23_050316_add_creator_in_payments_table.php | 4 +++- .../2020_11_23_050333_add_creator_in_expenses_table.php | 4 +++- .../2020_11_23_050406_add_creator_in_items_table.php | 4 +++- .../2020_11_23_065815_add_creator_in_users_table.php | 4 +++- .../2021_07_06_070204_add_owner_id_to_companies_table.php | 4 +++- .../2021_07_08_110940_add_company_to_notes_table.php | 4 +++- ..._063712_add_recurring_invoice_id_to_invoices_table.php | 3 +++ ...55_add_recurring_invoice_id_to_invoice_items_table.php | 3 +++ ...1_07_16_080253_add_currency_id_into_invoices_table.php | 3 +++ ...1_07_16_080508_add_currency_id_into_payments_table.php | 3 +++ ...2021_07_16_080611_add_currency_id_into_items_table.php | 3 +++ ...2021_07_16_080702_add_currency_id_into_taxes_table.php | 3 +++ ..._07_16_112429_add_currency_id_into_estimates_table.php | 3 +++ .../2021_08_05_103535_create_exchange_rate_logs_table.php | 2 +- ..._06_100539_add_recurring_invoice_id_to_taxes_table.php | 3 +++ ...1_11_13_051127_add_payment_method_to_expense_table.php | 3 +++ ..._12_04_123315_add_transaction_id_to_payments_table.php | 3 +++ 23 files changed, 71 insertions(+), 14 deletions(-) diff --git a/database/migrations/2020_02_01_063235_create_custom_fields_table.php b/database/migrations/2020_02_01_063235_create_custom_fields_table.php index 2d695a2b..58731642 100644 --- a/database/migrations/2020_02_01_063235_create_custom_fields_table.php +++ b/database/migrations/2020_02_01_063235_create_custom_fields_table.php @@ -43,6 +43,11 @@ class CreateCustomFieldsTable extends Migration */ public function down() { + Schema::table('custom_fields', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'company_id' ] ); + } + }); Schema::dropIfExists('custom_fields'); } } diff --git a/database/migrations/2020_02_01_063509_create_custom_field_values_table.php b/database/migrations/2020_02_01_063509_create_custom_field_values_table.php index 7701013d..c03ccc0f 100644 --- a/database/migrations/2020_02_01_063509_create_custom_field_values_table.php +++ b/database/migrations/2020_02_01_063509_create_custom_field_values_table.php @@ -39,6 +39,12 @@ class CreateCustomFieldValuesTable extends Migration */ public function down() { - Schema::dropIfExists('answers'); + Schema::table('custom_field_values', function (Blueprint $table){ + if (config('database.default') !== 'sqlite') { + $table->dropForeign(['custom_field_id']); + $table->dropForeign(['company_id']); + } + }); + Schema::dropIfExists('custom_field_values'); } } diff --git a/database/migrations/2020_05_12_154129_add_user_id_to_expenses_table.php b/database/migrations/2020_05_12_154129_add_user_id_to_expenses_table.php index 130994c1..ddb4c8e0 100644 --- a/database/migrations/2020_05_12_154129_add_user_id_to_expenses_table.php +++ b/database/migrations/2020_05_12_154129_add_user_id_to_expenses_table.php @@ -26,8 +26,6 @@ class AddUserIdToExpensesTable extends Migration */ public function down() { - Schema::table('expenses', function (Blueprint $table) { - $table->dropColumn('paid'); - }); + } } diff --git a/database/migrations/2020_10_01_102913_add_company_to_addresses_table.php b/database/migrations/2020_10_01_102913_add_company_to_addresses_table.php index 570fe919..e643a700 100644 --- a/database/migrations/2020_10_01_102913_add_company_to_addresses_table.php +++ b/database/migrations/2020_10_01_102913_add_company_to_addresses_table.php @@ -28,7 +28,9 @@ class AddCompanyToAddressesTable extends Migration public function down() { Schema::table('addresses', function (Blueprint $table) { - $table->dropForeign(['company_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'company_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_050206_add_creator_in_invoices_table.php b/database/migrations/2020_11_23_050206_add_creator_in_invoices_table.php index 81fd5906..ac330667 100644 --- a/database/migrations/2020_11_23_050206_add_creator_in_invoices_table.php +++ b/database/migrations/2020_11_23_050206_add_creator_in_invoices_table.php @@ -27,7 +27,9 @@ class AddCreatorInInvoicesTable extends Migration public function down() { Schema::table('invoices', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_050252_add_creator_in_estimates_table.php b/database/migrations/2020_11_23_050252_add_creator_in_estimates_table.php index 59263bb2..6963e658 100644 --- a/database/migrations/2020_11_23_050252_add_creator_in_estimates_table.php +++ b/database/migrations/2020_11_23_050252_add_creator_in_estimates_table.php @@ -27,7 +27,9 @@ class AddCreatorInEstimatesTable extends Migration public function down() { Schema::table('estimates', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_050316_add_creator_in_payments_table.php b/database/migrations/2020_11_23_050316_add_creator_in_payments_table.php index e16cc469..ea622243 100644 --- a/database/migrations/2020_11_23_050316_add_creator_in_payments_table.php +++ b/database/migrations/2020_11_23_050316_add_creator_in_payments_table.php @@ -27,7 +27,9 @@ class AddCreatorInPaymentsTable extends Migration public function down() { Schema::table('payments', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_050333_add_creator_in_expenses_table.php b/database/migrations/2020_11_23_050333_add_creator_in_expenses_table.php index 02e0fd5a..676edb80 100644 --- a/database/migrations/2020_11_23_050333_add_creator_in_expenses_table.php +++ b/database/migrations/2020_11_23_050333_add_creator_in_expenses_table.php @@ -27,7 +27,9 @@ class AddCreatorInExpensesTable extends Migration public function down() { Schema::table('expenses', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_050406_add_creator_in_items_table.php b/database/migrations/2020_11_23_050406_add_creator_in_items_table.php index 5d1a8b81..d5d9d279 100644 --- a/database/migrations/2020_11_23_050406_add_creator_in_items_table.php +++ b/database/migrations/2020_11_23_050406_add_creator_in_items_table.php @@ -27,7 +27,9 @@ class AddCreatorInItemsTable extends Migration public function down() { Schema::table('items', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2020_11_23_065815_add_creator_in_users_table.php b/database/migrations/2020_11_23_065815_add_creator_in_users_table.php index 15797a10..ba3d6e9f 100644 --- a/database/migrations/2020_11_23_065815_add_creator_in_users_table.php +++ b/database/migrations/2020_11_23_065815_add_creator_in_users_table.php @@ -27,7 +27,9 @@ class AddCreatorInUsersTable extends Migration public function down() { Schema::table('users', function (Blueprint $table) { - $table->dropForeign(['creator_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'creator_id' ] ); + } }); } } diff --git a/database/migrations/2021_07_06_070204_add_owner_id_to_companies_table.php b/database/migrations/2021_07_06_070204_add_owner_id_to_companies_table.php index fe241e17..677b0c6a 100644 --- a/database/migrations/2021_07_06_070204_add_owner_id_to_companies_table.php +++ b/database/migrations/2021_07_06_070204_add_owner_id_to_companies_table.php @@ -52,7 +52,9 @@ class AddOwnerIdToCompaniesTable extends Migration { Schema::table('companies', function (Blueprint $table) { $table->dropColumn('slug'); - $table->dropForeign(['owner_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'owner_id' ] ); + } }); } } diff --git a/database/migrations/2021_07_08_110940_add_company_to_notes_table.php b/database/migrations/2021_07_08_110940_add_company_to_notes_table.php index bee0f7d2..f7e2c903 100644 --- a/database/migrations/2021_07_08_110940_add_company_to_notes_table.php +++ b/database/migrations/2021_07_08_110940_add_company_to_notes_table.php @@ -39,7 +39,9 @@ class AddCompanyToNotesTable extends Migration public function down() { Schema::table('notes', function (Blueprint $table) { - $table->dropForeign(['company_id']); + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'company_id' ] ); + } }); } } diff --git a/database/migrations/2021_07_09_063712_add_recurring_invoice_id_to_invoices_table.php b/database/migrations/2021_07_09_063712_add_recurring_invoice_id_to_invoices_table.php index bacec8d0..068d512a 100644 --- a/database/migrations/2021_07_09_063712_add_recurring_invoice_id_to_invoices_table.php +++ b/database/migrations/2021_07_09_063712_add_recurring_invoice_id_to_invoices_table.php @@ -27,6 +27,9 @@ class AddRecurringInvoiceIdToInvoicesTable extends Migration public function down() { Schema::table('invoices', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'recurring_invoice_id' ] ); + } $table->dropColumn('recurring_invoice_id'); }); } diff --git a/database/migrations/2021_07_09_063755_add_recurring_invoice_id_to_invoice_items_table.php b/database/migrations/2021_07_09_063755_add_recurring_invoice_id_to_invoice_items_table.php index 063c6d34..12261049 100644 --- a/database/migrations/2021_07_09_063755_add_recurring_invoice_id_to_invoice_items_table.php +++ b/database/migrations/2021_07_09_063755_add_recurring_invoice_id_to_invoice_items_table.php @@ -28,6 +28,9 @@ class AddRecurringInvoiceIdToInvoiceItemsTable extends Migration public function down() { Schema::table('invoice_items', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'recurring_invoice_id' ] ); + } $table->dropColumn('recurring_invoice_id'); }); } diff --git a/database/migrations/2021_07_16_080253_add_currency_id_into_invoices_table.php b/database/migrations/2021_07_16_080253_add_currency_id_into_invoices_table.php index ad754f0d..a6f33ffa 100644 --- a/database/migrations/2021_07_16_080253_add_currency_id_into_invoices_table.php +++ b/database/migrations/2021_07_16_080253_add_currency_id_into_invoices_table.php @@ -27,6 +27,9 @@ class AddCurrencyIdIntoInvoicesTable extends Migration public function down() { Schema::table('invoices', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'currency_id' ] ); + } $table->dropColumn('currency_id'); }); } diff --git a/database/migrations/2021_07_16_080508_add_currency_id_into_payments_table.php b/database/migrations/2021_07_16_080508_add_currency_id_into_payments_table.php index ae49674c..69954d12 100644 --- a/database/migrations/2021_07_16_080508_add_currency_id_into_payments_table.php +++ b/database/migrations/2021_07_16_080508_add_currency_id_into_payments_table.php @@ -27,6 +27,9 @@ class AddCurrencyIdIntoPaymentsTable extends Migration public function down() { Schema::table('payments', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'currency_id' ] ); + } $table->dropColumn('currency_id'); }); } diff --git a/database/migrations/2021_07_16_080611_add_currency_id_into_items_table.php b/database/migrations/2021_07_16_080611_add_currency_id_into_items_table.php index 370fcf9d..dea454ac 100644 --- a/database/migrations/2021_07_16_080611_add_currency_id_into_items_table.php +++ b/database/migrations/2021_07_16_080611_add_currency_id_into_items_table.php @@ -27,6 +27,9 @@ class AddCurrencyIdIntoItemsTable extends Migration public function down() { Schema::table('items', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'currency_id' ] ); + } $table->dropColumn('currency_id'); }); } diff --git a/database/migrations/2021_07_16_080702_add_currency_id_into_taxes_table.php b/database/migrations/2021_07_16_080702_add_currency_id_into_taxes_table.php index d1745bb3..a1fa353c 100644 --- a/database/migrations/2021_07_16_080702_add_currency_id_into_taxes_table.php +++ b/database/migrations/2021_07_16_080702_add_currency_id_into_taxes_table.php @@ -27,6 +27,9 @@ class AddCurrencyIdIntoTaxesTable extends Migration public function down() { Schema::table('taxes', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'currency_id' ] ); + } $table->dropColumn('currency_id'); }); } diff --git a/database/migrations/2021_07_16_112429_add_currency_id_into_estimates_table.php b/database/migrations/2021_07_16_112429_add_currency_id_into_estimates_table.php index 724ff379..49fd8a0e 100644 --- a/database/migrations/2021_07_16_112429_add_currency_id_into_estimates_table.php +++ b/database/migrations/2021_07_16_112429_add_currency_id_into_estimates_table.php @@ -27,6 +27,9 @@ class AddCurrencyIdIntoEstimatesTable extends Migration public function down() { Schema::table('estimates', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'currency_id' ] ); + } $table->dropColumn('currency_id'); }); } diff --git a/database/migrations/2021_08_05_103535_create_exchange_rate_logs_table.php b/database/migrations/2021_08_05_103535_create_exchange_rate_logs_table.php index 11dda3d6..c3dc9cf5 100644 --- a/database/migrations/2021_08_05_103535_create_exchange_rate_logs_table.php +++ b/database/migrations/2021_08_05_103535_create_exchange_rate_logs_table.php @@ -33,6 +33,6 @@ class CreateExchangeRateLogsTable extends Migration */ public function down() { - Schema::dropIfExists('exchange_rates'); + Schema::dropIfExists('exchange_rate_logs'); } } diff --git a/database/migrations/2021_10_06_100539_add_recurring_invoice_id_to_taxes_table.php b/database/migrations/2021_10_06_100539_add_recurring_invoice_id_to_taxes_table.php index 90da41a7..80daf59e 100644 --- a/database/migrations/2021_10_06_100539_add_recurring_invoice_id_to_taxes_table.php +++ b/database/migrations/2021_10_06_100539_add_recurring_invoice_id_to_taxes_table.php @@ -27,6 +27,9 @@ class AddRecurringInvoiceIdToTaxesTable extends Migration public function down() { Schema::table('taxes', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'recurring_invoice_id' ] ); + } $table->dropColumn('recurring_invoice_id'); }); } diff --git a/database/migrations/2021_11_13_051127_add_payment_method_to_expense_table.php b/database/migrations/2021_11_13_051127_add_payment_method_to_expense_table.php index c1fbabdb..ce0190d5 100644 --- a/database/migrations/2021_11_13_051127_add_payment_method_to_expense_table.php +++ b/database/migrations/2021_11_13_051127_add_payment_method_to_expense_table.php @@ -27,6 +27,9 @@ class AddPaymentMethodToExpenseTable extends Migration public function down() { Schema::table('expenses', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'payment_method_id' ] ); + } $table->dropColumn('payment_method_id'); }); } diff --git a/database/migrations/2021_12_04_123315_add_transaction_id_to_payments_table.php b/database/migrations/2021_12_04_123315_add_transaction_id_to_payments_table.php index 97b281cf..1b31e77b 100644 --- a/database/migrations/2021_12_04_123315_add_transaction_id_to_payments_table.php +++ b/database/migrations/2021_12_04_123315_add_transaction_id_to_payments_table.php @@ -27,6 +27,9 @@ class AddTransactionIdToPaymentsTable extends Migration public function down() { Schema::table('payments', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign( [ 'transaction_id' ] ); + } $table->dropColumn('transaction_id'); }); } From d02e0b8e8302866210558929ab41afeae5a11d66 Mon Sep 17 00:00:00 2001 From: gdarko Date: Mon, 29 Jan 2024 00:00:17 +0100 Subject: [PATCH 04/11] Fix hashids issue related to the length parameter type --- config/hashids.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/hashids.php b/config/hashids.php index 16f8c7e6..e4fd27ce 100644 --- a/config/hashids.php +++ b/config/hashids.php @@ -45,32 +45,32 @@ return [ 'connections' => [ Invoice::class => [ 'salt' => Invoice::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 'XKyIAR7mgt8jD2vbqPrOSVenNGpiYLx4M61T', ], Estimate::class => [ 'salt' => Estimate::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 'yLJWP79M8rYVqbn1NXjulO6IUDdvekRQGo40', ], Payment::class => [ 'salt' => Payment::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 'asqtW3eDRIxB65GYl7UVLS1dybn9XrKTZ4zO', ], Company::class => [ 'salt' => Company::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 's0DxOFtEYEnuKPmP08Ch6A1iHlLmBTBVWms5', ], EmailLog::class => [ 'salt' => EmailLog::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 'BRAMEz5str5UVe9oCqzoYY2oKgUi8wQQSmrR', ], Transaction::class => [ 'salt' => Transaction::class.config('app.key'), - 'length' => '20', + 'length' => 20, 'alphabet' => 'ADyQWE8mgt7jF2vbnPrKLJenHVpiUIq4M12T', ], ], From 257cfb30bb15ad9766437be474f090e71296dae7 Mon Sep 17 00:00:00 2001 From: gdarko Date: Sun, 28 Jan 2024 17:52:10 -0600 Subject: [PATCH 05/11] Update docker images --- Dockerfile | 3 ++- docker-compose.yml | 2 +- docker-compose/cron.dockerfile | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 581d0411..2df8e43b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm +FROM php:8.1-fpm-bookworm # Arguments defined in docker-compose.yml ARG user @@ -8,6 +8,7 @@ ARG uid RUN apt-get update && apt-get install -y \ git \ curl \ + nano \ libpng-dev \ libonig-dev \ libxml2-dev \ diff --git a/docker-compose.yml b/docker-compose.yml index 54e6f35c..0790656c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: - invoiceshelf db: - image: mariadb + image: mariadb:10.11 restart: always volumes: - db:/var/lib/mysql diff --git a/docker-compose/cron.dockerfile b/docker-compose/cron.dockerfile index 38598c00..4e76af25 100644 --- a/docker-compose/cron.dockerfile +++ b/docker-compose/cron.dockerfile @@ -1,10 +1,10 @@ -FROM php:8.0-fpm-alpine +FROM php:8.1-fpm-bookworm -RUN apk add --no-cache \ - php8-bcmath +RUN apt update && apt install -y cron RUN docker-php-ext-install pdo pdo_mysql bcmath COPY docker-compose/crontab /etc/crontabs/root +RUN crontab /etc/crontabs/root -CMD ["crond", "-f"] +CMD ["/usr/sbin/cron", "-f"] From f156f5c9c0beddcfd8b480948f1dbde3d7a99f0d Mon Sep 17 00:00:00 2001 From: gdarko Date: Sun, 28 Jan 2024 17:52:35 -0600 Subject: [PATCH 06/11] Fix add installation page logo --- .../admin/views/installation/Installation.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/scripts/admin/views/installation/Installation.vue b/resources/scripts/admin/views/installation/Installation.vue index bb2bf431..7a776bfb 100644 --- a/resources/scripts/admin/views/installation/Installation.vue +++ b/resources/scripts/admin/views/installation/Installation.vue @@ -1,6 +1,12 @@