Compare commits

...

7 commits

Author SHA1 Message Date
Copilot
0000cd7a02
Fix spelling and grammar mistakes in documentation (#1127)
Some checks failed
Build assets artifact / Build assets artifact (push) Has been cancelled
Docker Image Build / docker (push) Has been cancelled
Docker Image Build (FrankenPHP) / docker (push) Has been cancelled
Static analysis / Static analysis (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Has been cancelled
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Has been cancelled
* Initial plan

* Fix spelling and grammar mistakes in documentation

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
2025-12-05 00:05:31 +01:00
Copilot
9a1dbe06dc
Fix spelling and grammar mistakes in German and English translations (#1125)
* Initial plan

* Fix spelling and grammar mistakes in German and English translations

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
2025-12-04 23:44:03 +01:00
Jan Böhmer
fd7106af28 Allow that the DEFAULT_URI does not end with a slash
We normalize the url with an env var processor before passing it to the saml lib, to avoid an error. Fixes issue #1118
2025-12-04 23:31:42 +01:00
Jan Böhmer
cb6da36954 Merge remote-tracking branch 'origin/master' 2025-12-04 23:04:47 +01:00
Jan Böhmer
a5275f7be7 Increase DB field length for URLs to 2048 chars
This fixes issue #1122
2025-12-04 23:04:44 +01:00
dependabot[bot]
17f9755b86
Bump actions/checkout from 5 to 6 (#1116)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-04 22:41:11 +01:00
Copilot
a3d6f77fda
Add missing German translations to messages.de.xlf (#1124)
* Initial plan

* Add 41 missing German translations to messages.de.xlf

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
2025-12-04 22:33:59 +01:00
40 changed files with 568 additions and 73 deletions

1
.env
View file

@ -32,7 +32,6 @@ DATABASE_EMULATE_NATURAL_SORT=0
################################################################################### ###################################################################################
# The public reachable URL of this Part-DB installation. This is used for generating links in SAML and email templates or when no request context is available. # The public reachable URL of this Part-DB installation. This is used for generating links in SAML and email templates or when no request context is available.
# This must end with a slash!
DEFAULT_URI="https://partdb.changeme.invalid/" DEFAULT_URI="https://partdb.changeme.invalid/"
################################################################################### ###################################################################################

View file

@ -22,7 +22,7 @@ jobs:
APP_ENV: prod APP_ENV: prod
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2

View file

@ -20,7 +20,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- -
name: Docker meta name: Docker meta
id: docker_meta id: docker_meta

View file

@ -20,7 +20,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- -
name: Docker meta name: Docker meta
id: docker_meta id: docker_meta

View file

@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2

View file

@ -46,7 +46,7 @@ jobs:
if: matrix.db-type == 'postgres' if: matrix.db-type == 'postgres'
- name: Checkout - name: Checkout
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2

View file

@ -20,7 +20,7 @@ was translated in other languages (this is possible via the "Other languages" dr
## Project structure ## Project structure
Part-DB uses symfony's recommended [project structure](https://symfony.com/doc/current/best_practices.html). Part-DB uses symfony's recommended [project structure](https://symfony.com/doc/current/best_practices.html).
Interesting folders are: Interesting folders are:
* `public`: Everything in this directory will be publicy accessible via web. Use this folder to serve static images. * `public`: Everything in this directory will be publicly accessible via web. Use this folder to serve static images.
* `assets`: The frontend assets are saved here. You can find the javascript and CSS code here. * `assets`: The frontend assets are saved here. You can find the javascript and CSS code here.
* `src`: Part-DB's PHP code is saved here. Note that the sub directories are structured by the classes purposes (so use `Controller` Controllers, `Entities` for Database models, etc.) * `src`: Part-DB's PHP code is saved here. Note that the sub directories are structured by the classes purposes (so use `Controller` Controllers, `Entities` for Database models, etc.)
* `translations`: The translations used in Part-DB are saved here * `translations`: The translations used in Part-DB are saved here
@ -49,7 +49,7 @@ Part-DB uses GitHub actions to run various tests and checks on the code:
* PHPunit tests run successful * PHPunit tests run successful
* Config files, translations and templates has valid syntax * Config files, translations and templates has valid syntax
* Doctrine schema valid * Doctrine schema valid
* No known vulnerable dependecies are used * No known vulnerable dependencies are used
* Static analysis successful (phpstan with `--level=2`) * Static analysis successful (phpstan with `--level=2`)
Further the code coverage of the PHPunit tests is determined and uploaded to [CodeCov](https://codecov.io/gh/Part-DB/Part-DB-server). Further the code coverage of the PHPunit tests is determined and uploaded to [CodeCov](https://codecov.io/gh/Part-DB/Part-DB-server).

View file

@ -29,8 +29,8 @@ If you want to test Part-DB without installing it, you can use [this](https://de
You can log in with username: *user* and password: *user*. You can log in with username: *user* and password: *user*.
Every change to the master branch gets automatically deployed, so it represents the current development progress and is Every change to the master branch gets automatically deployed, so it represents the current development progress and
may not completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading may not be completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading
the page the page
for the first time. for the first time.

View file

@ -10,7 +10,7 @@ parameters:
partdb.title: '%env(string:settings:customization:instanceName)%' # The title shown inside of Part-DB (e.g. in the navbar and on homepage) partdb.title: '%env(string:settings:customization:instanceName)%' # The title shown inside of Part-DB (e.g. in the navbar and on homepage)
partdb.locale_menu: ['en', 'de', 'it', 'fr', 'ru', 'ja', 'cs', 'da', 'zh', 'pl', 'hu'] # The languages that are shown in user drop down menu partdb.locale_menu: ['en', 'de', 'it', 'fr', 'ru', 'ja', 'cs', 'da', 'zh', 'pl', 'hu'] # The languages that are shown in user drop down menu
partdb.default_uri: '%env(string:DEFAULT_URI)%' # The default URI to use for the Part-DB instance (e.g. https://part-db.example.com/). This is used for generating links in emails partdb.default_uri: '%env(addSlash:string:DEFAULT_URI)%' # The default URI to use for the Part-DB instance (e.g. https://part-db.example.com/). This is used for generating links in emails
partdb.db.emulate_natural_sort: '%env(bool:DATABASE_EMULATE_NATURAL_SORT)%' # If this is set to true, natural sorting is emulated on platforms that do not support it natively. This can be slow on large datasets. partdb.db.emulate_natural_sort: '%env(bool:DATABASE_EMULATE_NATURAL_SORT)%' # If this is set to true, natural sorting is emulated on platforms that do not support it natively. This can be slow on large datasets.

View file

@ -17,7 +17,7 @@ This allows external applications to interact with Part-DB, extend it or integra
> Some features might be missing or not working yet. > Some features might be missing or not working yet.
> Also be aware, that there might be security issues in the API, which could allow attackers to access or edit data via > Also be aware, that there might be security issues in the API, which could allow attackers to access or edit data via
> the API, which > the API, which
> they normally should be able to access. So currently you should only use the API with trusted users and trusted > they normally should not be able to access. So currently you should only use the API with trusted users and trusted
> applications. > applications.
Part-DB uses [API Platform](https://api-platform.com/) to provide the API, which allows for easy creation of REST APIs Part-DB uses [API Platform](https://api-platform.com/) to provide the API, which allows for easy creation of REST APIs
@ -106,11 +106,11 @@ This is a great way to test the API and see how it works, without having to writ
By default, all list endpoints are paginated, which means only a certain number of results is returned per request. By default, all list endpoints are paginated, which means only a certain number of results is returned per request.
To get another page of the results, you have to use the `page` query parameter, which contains the page number you want To get another page of the results, you have to use the `page` query parameter, which contains the page number you want
to get (e.g. `/api/categoues/?page=2`). to get (e.g. `/api/categories/?page=2`).
When using JSONLD, the links to the next page are also included in the `hydra:view` property of the response. When using JSONLD, the links to the next page are also included in the `hydra:view` property of the response.
To change the size of the pages (the number of items in a single page) use the `itemsPerPage` query parameter ( To change the size of the pages (the number of items in a single page) use the `itemsPerPage` query parameter (
e.g. `/api/categoues/?itemsPerPage=50`). e.g. `/api/categories/?itemsPerPage=50`).
See [API Platform docs](https://api-platform.com/docs/core/pagination) for more infos. See [API Platform docs](https://api-platform.com/docs/core/pagination) for more infos.

View file

@ -28,7 +28,7 @@ A part entity has many fields, which can be used to describe it better. Most of
the comment field or the specifications the comment field or the specifications
* **Category** (Required): The category (see there) to which this part belongs to. * **Category** (Required): The category (see there) to which this part belongs to.
* **Tags**: The list of tags this part belongs to. Tags can be used to group parts logically (similar to the category), * **Tags**: The list of tags this part belongs to. Tags can be used to group parts logically (similar to the category),
but tags are much less strict and formal (they don't have to be defined forehands) and you can assign multiple tags to but tags are much less strict and formal (they don't have to be defined beforehand) and you can assign multiple tags to
a part. When clicking on a tag, a list with all parts which have the same tag, is shown. a part. When clicking on a tag, a list with all parts which have the same tag, is shown.
* **Min Instock**: *Not really implemented yet*. Parts where the total instock is below this value, will show up for * **Min Instock**: *Not really implemented yet*. Parts where the total instock is below this value, will show up for
ordering. ordering.

View file

@ -10,7 +10,7 @@ Part-DBs behavior can be configured to your needs. There are different kinds of
user-changeable (changeable dynamically via frontend), options that can be configured by environment variables, and user-changeable (changeable dynamically via frontend), options that can be configured by environment variables, and
options that are only configurable via Symfony config files. options that are only configurable via Symfony config files.
## User configruation ## User configuration
The following things can be changed for every user and a user can change it for himself (if he has the correct permission The following things can be changed for every user and a user can change it for himself (if he has the correct permission
for it). Configuration is either possible via the user's own settings page (where you can also change the password) or via for it). Configuration is either possible via the user's own settings page (where you can also change the password) or via
@ -43,7 +43,7 @@ options listed, see `.env` file for the full list of possible env variables.
Environment variables allow to overwrite settings in the web interface. This is useful, if you want to enforce certain Environment variables allow to overwrite settings in the web interface. This is useful, if you want to enforce certain
settings to be unchangable by users, or if you want to configure settings in a central place in a deployed environment. settings to be unchangable by users, or if you want to configure settings in a central place in a deployed environment.
On the settings page, you can hover over a setting to see, which environment variable can be used to overwrite it, it On the settings page, you can hover over a setting to see, which environment variable can be used to overwrite it, it
is shown as tooltip. API keys or similar sensitve data which is overwritten by env variables, are redacted on the web is shown as tooltip. API keys or similar sensitive data which is overwritten by env variables, are redacted on the web
interface, so that even administrators cannot see them (only the last 2 characters and the length). interface, so that even administrators cannot see them (only the last 2 characters and the length).
For technical and security reasons some settings can only be configured via environment variables and not via the web For technical and security reasons some settings can only be configured via environment variables and not via the web
@ -116,7 +116,7 @@ bundled with Part-DB. Set `DATABASE_MYSQL_SSL_VERIFY_CERT` if you want to accept
value should be handled as confidential data and not shared publicly. value should be handled as confidential data and not shared publicly.
* `SHOW_PART_IMAGE_OVERLAY`: Set to 0 to disable the part image overlay, which appears if you hover over an image in the * `SHOW_PART_IMAGE_OVERLAY`: Set to 0 to disable the part image overlay, which appears if you hover over an image in the
part image gallery part image gallery
* `IPN_SUGGEST_REGEX`: A global regular expression, that part IPNs have to fullfill. Enforce your own format for your users. * `IPN_SUGGEST_REGEX`: A global regular expression, that part IPNs have to fulfill. Enforce your own format for your users.
* `IPN_SUGGEST_REGEX_HELP`: Define your own user help text for the Regex format specification. * `IPN_SUGGEST_REGEX_HELP`: Define your own user help text for the Regex format specification.
* `IPN_AUTO_APPEND_SUFFIX`: When enabled, an incremental suffix will be added to the user input when entering an existing * `IPN_AUTO_APPEND_SUFFIX`: When enabled, an incremental suffix will be added to the user input when entering an existing
* IPN again upon saving. * IPN again upon saving.

View file

@ -18,8 +18,7 @@ It is installed on a web server and so can be accessed with any browser without
> You can log in with username: **user** and password: **user**, to change/create data. > You can log in with username: **user** and password: **user**, to change/create data.
> >
> Every change to the master branch gets automatically deployed, so it represents the current development progress and > Every change to the master branch gets automatically deployed, so it represents the current development progress and
> is > may not be completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading
> maybe not completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading
> the page > the page
> for the first time. > for the first time.
@ -53,7 +52,7 @@ It is installed on a web server and so can be accessed with any browser without
KiCad and see available parts from Part-DB directly inside KiCad. KiCad and see available parts from Part-DB directly inside KiCad.
With these features Part-DB is useful to hobbyists, who want to keep track of their private electronic parts inventory, With these features Part-DB is useful to hobbyists, who want to keep track of their private electronic parts inventory,
or makerspaces, where many users have should have (controlled) access to the shared inventory. or makerspaces, where many users should have (controlled) access to the shared inventory.
Part-DB is also used by small companies and universities for managing their inventory. Part-DB is also used by small companies and universities for managing their inventory.

View file

@ -38,7 +38,7 @@ you have started creating data**. So you should choose the database type for you
* **Performance**: SQLite is not as fast as MySQL or PostgreSQL, especially when using complex queries or many users. * **Performance**: SQLite is not as fast as MySQL or PostgreSQL, especially when using complex queries or many users.
* **Emulated RegEx search**: SQLite does not support RegEx search natively. Part-DB can emulate it, however that is pretty slow. * **Emulated RegEx search**: SQLite does not support RegEx search natively. Part-DB can emulate it, however that is pretty slow.
* **Emualted natural sorting**: SQLite does not support natural sorting natively. Part-DB can emulate it, but it is pretty slow. * **Emulated natural sorting**: SQLite does not support natural sorting natively. Part-DB can emulate it, but it is pretty slow.
* **Limitations with Unicode**: SQLite has limitations in comparisons and sorting of Unicode characters, which might lead to * **Limitations with Unicode**: SQLite has limitations in comparisons and sorting of Unicode characters, which might lead to
unexpected behavior when using non-ASCII characters in your data. For example `µ` (micro sign) is not seen as equal to unexpected behavior when using non-ASCII characters in your data. For example `µ` (micro sign) is not seen as equal to
`μ` (greek minuscule mu), therefore searching for `µ` (micro sign) will not find parts containing `μ` (mu) and vice versa. `μ` (greek minuscule mu), therefore searching for `µ` (micro sign) will not find parts containing `μ` (mu) and vice versa.
@ -131,7 +131,7 @@ The host (here 127.0.0.1) and port should also be specified according to your My
In the `serverVersion` parameter you can specify the version of the MySQL/MariaDB server you are using, in the way the server returns it In the `serverVersion` parameter you can specify the version of the MySQL/MariaDB server you are using, in the way the server returns it
(e.g. `8.0.37` for MySQL and `10.4.14-MariaDB`). If you do not know it, you can leave the default value. (e.g. `8.0.37` for MySQL and `10.4.14-MariaDB`). If you do not know it, you can leave the default value.
If you want to use a unix socket for the connection instead of a TCP connnection, you can specify the socket path in the `unix_socket` parameter. If you want to use a unix socket for the connection instead of a TCP connection, you can specify the socket path in the `unix_socket` parameter.
```shell ```shell
DATABASE_URL="mysql://user:password@localhost/database?serverVersion=8.0.37&unix_socket=/var/run/mysqld/mysqld.sock" DATABASE_URL="mysql://user:password@localhost/database?serverVersion=8.0.37&unix_socket=/var/run/mysqld/mysqld.sock"
``` ```
@ -150,7 +150,7 @@ In the `serverVersion` parameter you can specify the version of the PostgreSQL s
The `charset` parameter specify the character set of the database. It should be set to `utf8` to ensure that all characters are stored correctly. The `charset` parameter specify the character set of the database. It should be set to `utf8` to ensure that all characters are stored correctly.
If you want to use a unix socket for the connection instead of a TCP connnection, you can specify the socket path in the `host` parameter. If you want to use a unix socket for the connection instead of a TCP connection, you can specify the socket path in the `host` parameter.
```shell ```shell
DATABASE_URL="postgresql://db_user@localhost/db_name?serverVersion=16.6&charset=utf8&host=/var/run/postgresql" DATABASE_URL="postgresql://db_user@localhost/db_name?serverVersion=16.6&charset=utf8&host=/var/run/postgresql"
``` ```
@ -177,6 +177,6 @@ In natural sorting, it would be sorted as:
Part-DB can sort names in part tables and tree views naturally. PostgreSQL and MariaDB 10.7+ support natural sorting natively, Part-DB can sort names in part tables and tree views naturally. PostgreSQL and MariaDB 10.7+ support natural sorting natively,
and it is automatically used if available. and it is automatically used if available.
For SQLite and MySQL < 10.7 it has to be emulated if wanted, which is pretty slow. Therefore it has to be explicity enabled by setting the For SQLite and MySQL < 10.7 it has to be emulated if wanted, which is pretty slow. Therefore it has to be explicitly enabled by setting the
`DATABASE_EMULATE_NATURAL_SORT` environment variable to `1`. If it is 0 the classical binary sorting is used, on these databases. The emulations `DATABASE_EMULATE_NATURAL_SORT` environment variable to `1`. If it is 0 the classical binary sorting is used, on these databases. The emulations
might have some quirks and issues, so it is recommended to use a database which supports natural sorting natively, if you want to use it. might have some quirks and issues, so it is recommended to use a database which supports natural sorting natively, if you want to use it.

View file

@ -19,7 +19,7 @@ automatic mail providers (like MailChimp or SendGrid). If you want to use one of
Mailer documentation for more information. Mailer documentation for more information.
We will only cover the configuration of an SMTP provider here, which is sufficient for most use-cases. We will only cover the configuration of an SMTP provider here, which is sufficient for most use-cases.
You will need an email account, which you can use send emails from via password-bases SMTP authentication, this account You will need an email account, which you can use to send emails from via password-based SMTP authentication, this account
should be dedicated to Part-DB. should be dedicated to Part-DB.
To configure the SMTP provider, you have to set the following environment variables: To configure the SMTP provider, you have to set the following environment variables:

View file

@ -143,11 +143,11 @@ services:
# - DB_AUTOMIGRATE=true # - DB_AUTOMIGRATE=true
# You can configure Part-DB using the webUI or environment variables # You can configure Part-DB using the webUI or environment variables
# However you can add add any other environment configuration you want here # However you can add any other environment configuration you want here
# See .env file for all available options or https://docs.part-db.de/configuration.html # See .env file for all available options or https://docs.part-db.de/configuration.html
# Override value if you want to show to show a given text on homepage. # Override value if you want to show a given text on homepage.
# When this is outcommented the webUI can be used to configure the banner # When this is commented out the webUI can be used to configure the banner
#- BANNER=This is a test banner<br>with a line break #- BANNER=This is a test banner<br>with a line break
database: database:

View file

@ -7,7 +7,7 @@ nav_order: 10
# Nginx # Nginx
You can also use [nginx](https://www.nginx.com/) as webserver for Part-DB. Setup Part-DB with apache is a bit easier, so You can also use [nginx](https://www.nginx.com/) as webserver for Part-DB. Setting up Part-DB with Apache is a bit easier, so
this is the method shown in the guides. This guide assumes that you already have a working nginx installation with PHP this is the method shown in the guides. This guide assumes that you already have a working nginx installation with PHP
configured. configured.

View file

@ -21,7 +21,7 @@ LDAP or Active Directory server.
{: .warning } {: .warning }
> This feature is currently in beta. Please report any bugs you find. > This feature is currently in beta. Please report any bugs you find.
> So far it has only tested with Keycloak, but it should work with any SAML 2.0 compatible identity provider. > So far it has only been tested with Keycloak, but it should work with any SAML 2.0 compatible identity provider.
This guide will show you how to configure Part-DB with [Keycloak](https://www.keycloak.org/) as the SAML identity This guide will show you how to configure Part-DB with [Keycloak](https://www.keycloak.org/) as the SAML identity
provider, but it should work with any SAML 2.0 compatible identity provider. provider, but it should work with any SAML 2.0 compatible identity provider.
@ -75,8 +75,8 @@ the [Keycloak Getting Started Guide](https://www.keycloak.org/docs/latest/gettin
### Configure Part-DB to use SAML ### Configure Part-DB to use SAML
1. Open the `.env.local` file of Part-DB (or the docker-compose.yaml) for edit 1. Open the `.env.local` file of Part-DB (or the docker-compose.yaml) for editing
2. Set the `SAMLP_SP_PRIVATE_KEY` environment variable to the content of the private key file you downloaded in the 2. Set the `SAML_SP_PRIVATE_KEY` environment variable to the content of the private key file you downloaded in the
previous step. It should start with `MIEE` and end with `=`. previous step. It should start with `MIEE` and end with `=`.
3. Set the `SAML_SP_X509_CERT` environment variable to the content of the Certificate field shown in the `Keys` tab of 3. Set the `SAML_SP_X509_CERT` environment variable to the content of the Certificate field shown in the `Keys` tab of
the SAML client in Keycloak. It should start with `MIIC` and end with `=`. the SAML client in Keycloak. It should start with `MIIC` and end with `=`.

View file

@ -9,7 +9,7 @@ Sometimes things go wrong and Part-DB shows an error message. This page should h
## Error messages ## Error messages
When a common, easy fixable error occurs (like a non-up-to-date database), Part-DB will show you some short instructions When a common, easily fixable error occurs (like a non-up-to-date database), Part-DB will show you some short instructions
on how to fix the problem. If you have a problem that is not listed here, please open an issue on GitHub. on how to fix the problem. If you have a problem that is not listed here, please open an issue on GitHub.
## General procedure ## General procedure

View file

@ -27,7 +27,7 @@ about the requirements at all.
## Changes ## Changes
* Configuration is now preferably done via a web settings interface. You can still use environment variables, these overwrite * Configuration is now preferably done via a web settings interface. You can still use environment variables, these overwrite
the settings in the web interface. Existing configuration will still work, but you should consider migriting them to the the settings in the web interface. Existing configuration will still work, but you should consider migrating them to the
web interface as described below. web interface as described below.
* The `config/banner.md` file that could been used to customize the banner text, was removed. You can now set the banner text * The `config/banner.md` file that could been used to customize the banner text, was removed. You can now set the banner text
directly in the admin interface, or by setting the `BANNER` environment variable. If you want to keep your existing directly in the admin interface, or by setting the `BANNER` environment variable. If you want to keep your existing
@ -43,7 +43,7 @@ The upgrade process works very similar to a normal (minor release) upgrade.
### Direct installation ### Direct installation
**Be sure to execute the following steps as the user that owns the Part-DB files (e.g. `www-data`, or your webserver user). So prepend a `sudo -u wwww-data` where necessary.** **Be sure to execute the following steps as the user that owns the Part-DB files (e.g. `www-data`, or your webserver user). So prepend a `sudo -u www-data` where necessary.**
1. Make a backup of your existing Part-DB installation, including the database, data directories and the configuration files and `.env.local` file. 1. Make a backup of your existing Part-DB installation, including the database, data directories and the configuration files and `.env.local` file.
The `php bin/console partdb:backup` command can help you with this. The `php bin/console partdb:backup` command can help you with this.
@ -51,7 +51,7 @@ The `php bin/console partdb:backup` command can help you with this.
3. Remove the `var/cache/` directory inside the Part-DB installation to ensure that no old cache files remain. 3. Remove the `var/cache/` directory inside the Part-DB installation to ensure that no old cache files remain.
4. Run `composer install --no-dev -o` to update the dependencies. 4. Run `composer install --no-dev -o` to update the dependencies.
5. Run `yarn install` and `yarn build` to update the frontend assets. 5. Run `yarn install` and `yarn build` to update the frontend assets.
6. Rund `php bin/console doctrine:migrations:migrate` to update the database schema. 6. Run `php bin/console doctrine:migrations:migrate` to update the database schema.
7. Clear the cache with `php bin/console cache:clear`. 7. Clear the cache with `php bin/console cache:clear`.
8. Open your Part-DB instance in the browser and log in as an admin user. 8. Open your Part-DB instance in the browser and log in as an admin user.
9. Go to the user or group permissions page, and give yourself (and other administrators) the right to change system settings (under "System" and "Configuration"). 9. Go to the user or group permissions page, and give yourself (and other administrators) the right to change system settings (under "System" and "Configuration").
@ -79,7 +79,7 @@ To change it, you must migrate your environment variable configuration to the ne
For this there is the new console command `settings:migrate-env-to-settings`, which reads in all environment variables used to overwrite For this there is the new console command `settings:migrate-env-to-settings`, which reads in all environment variables used to overwrite
settings and write them to the database, so that you can safely delete them from your environment variable configuration afterwards, without settings and write them to the database, so that you can safely delete them from your environment variable configuration afterwards, without
loosing your configuration. losing your configuration.
To run the command, execute `php bin/console settings:migrate-env-to-settings --all` as webserver user (or run `docker exec --user=www-data -it partdb php bin/console settings:migrate-env-to-settings --all` for docker containers). To run the command, execute `php bin/console settings:migrate-env-to-settings --all` as webserver user (or run `docker exec --user=www-data -it partdb php bin/console settings:migrate-env-to-settings --all` for docker containers).
It will list you all environment variables, it found and ask you for confirmation to migrate them. Answer with `yes` to migrate them and hit enter. It will list you all environment variables, it found and ask you for confirmation to migrate them. Answer with `yes` to migrate them and hit enter.

View file

@ -6,4 +6,4 @@ has_children: true
--- ---
This section provides information on how to upgrade Part-DB to the latest version. This section provides information on how to upgrade Part-DB to the latest version.
This is intended for major release upgrades, where requirements or things changes significantly. This is intended for major release upgrades, where requirements or things change significantly.

View file

@ -24,7 +24,7 @@ sections carefully before proceeding to upgrade.
also more sensitive stuff like database migration works via CLI now, so you should have console access on your server. also more sensitive stuff like database migration works via CLI now, so you should have console access on your server.
* Markdown/HTML is now used instead of BBCode for rich text in description and command fields. * Markdown/HTML is now used instead of BBCode for rich text in description and command fields.
It is possible to migrate your existing BBCode to Markdown It is possible to migrate your existing BBCode to Markdown
via `php bin/console php bin/console partdb:migrations:convert-bbcode`. via `php bin/console partdb:migrations:convert-bbcode`.
* Server exceptions are not logged into event log anymore. For security reasons (exceptions can contain sensitive * Server exceptions are not logged into event log anymore. For security reasons (exceptions can contain sensitive
information) exceptions are only logged to server log (by default under './var/log'), so only the server admins can access it. information) exceptions are only logged to server log (by default under './var/log'), so only the server admins can access it.
* Profile labels are now saved in the database (before they were saved in a separate JSON file). **The profiles of legacy * Profile labels are now saved in the database (before they were saved in a separate JSON file). **The profiles of legacy

View file

@ -27,7 +27,7 @@ for more info about these options.
## Backup (manual) ## Backup (manual)
3 parts have to be backup-ed: The configuration files, which contain the instance-specific options, the 3 parts have to be backed up: The configuration files, which contain the instance-specific options, the
uploaded files of attachments, and the database containing the most data of Part-DB. uploaded files of attachments, and the database containing the most data of Part-DB.
Everything else like thumbnails and cache files, are recreated automatically when needed. Everything else like thumbnails and cache files, are recreated automatically when needed.
@ -56,7 +56,7 @@ interface (`mysqldump -uBACKUP -pPASSWORD DATABASE`)
## Restore ## Restore
Install Part-DB as usual as described in the installation section, except for the database creation/migration part. You Install Part-DB as usual as described in the installation section, except for the database creation/migration part. You
have to use the same database type (SQLite or MySQL) as on the backuped server instance. have to use the same database type (SQLite or MySQL) as on the backed up server instance.
### Restore configuration ### Restore configuration
@ -71,7 +71,7 @@ Copy the `uploads/` and the `public/media/` folder from your backup into your ne
#### SQLite #### SQLite
Copy the backup-ed `app.db` into the database folder normally `var/app.db` in Part-DB root folder. Copy the backed up `app.db` into the database folder normally `var/app.db` in Part-DB root folder.
#### MySQL / MariaDB #### MySQL / MariaDB

View file

@ -60,7 +60,7 @@ If you type in a character, you will get an autocomplete list of all symbols and
### Parts and category visibility ### Parts and category visibility
Only parts and their categories, on which there is any kind of EDA metadata are defined show up in KiCad. So if you want to see parts in KiCad, Only parts and their categories on which there is any kind of EDA metadata defined show up in KiCad. So if you want to see parts in KiCad,
you need to define at least a symbol, footprint, reference prefix, or value on a part, category or footprint. you need to define at least a symbol, footprint, reference prefix, or value on a part, category or footprint.
You can use the "Force visibility" checkbox on a part or category to override this behavior and force parts to be visible or hidden in KiCad. You can use the "Force visibility" checkbox on a part or category to override this behavior and force parts to be visible or hidden in KiCad.

View file

@ -6,7 +6,7 @@ nav_order: 4
# Getting started # Getting started
After Part-DB you should begin with customizing the settings, and setting up the basic structures. After Part-DB you should begin with customizing the settings and setting up the basic structures.
Before starting, it's useful to read a bit about the [concepts of Part-DB]({% link concepts.md %}). Before starting, it's useful to read a bit about the [concepts of Part-DB]({% link concepts.md %}).
1. TOC 1. TOC

View file

@ -49,7 +49,7 @@ You can upload the file that should be imported here and choose various options
review" after the import. This can be useful if you want to review all imported parts before using them. review" after the import. This can be useful if you want to review all imported parts before using them.
* **Create unknown data structures**: If this is selected Part-DB will create new data structures (like categories, * **Create unknown data structures**: If this is selected Part-DB will create new data structures (like categories,
manufacturers, etc.) if no data structure(s) with the same name and path already exists. If this is not selected, only manufacturers, etc.) if no data structure(s) with the same name and path already exists. If this is not selected, only
existing data structures will be used and if no matching data strucure is found, the imported parts field will be empty. existing data structures will be used and if no matching data structure is found, the imported parts field will be empty.
* **Path delimiter**: Part-DB allows you to create/select nested data structures (like categories, manufacturers, etc.) * **Path delimiter**: Part-DB allows you to create/select nested data structures (like categories, manufacturers, etc.)
by using a path (e.g. `Category 1->Category 1.1`, which will select/create the `Category 1.1` whose parent by using a path (e.g. `Category 1->Category 1.1`, which will select/create the `Category 1.1` whose parent
is `Category 1`). This path is separated by the path delimiter. If you want to use a different path delimiter than the is `Category 1`). This path is separated by the path delimiter. If you want to use a different path delimiter than the

View file

@ -78,7 +78,7 @@ results will be shown.
## Data providers ## Data providers
The system tries to be as flexible as possible, so many different information sources can be used. The system tries to be as flexible as possible, so many different information sources can be used.
Each information source is called am "info provider" and handles the communication with the external source. Each information source is called an "info provider" and handles the communication with the external source.
The providers are just a driver that handles the communication with the different external sources and converts them The providers are just a driver that handles the communication with the different external sources and converts them
into a common format Part-DB understands. into a common format Part-DB understands.
That way it is pretty easy to create new providers as they just need to do very little work. That way it is pretty easy to create new providers as they just need to do very little work.
@ -157,7 +157,7 @@ again, to establish a new connection.
### TME ### TME
The TME provider uses the API of [TME](https://www.tme.eu/) to search for parts and getting shopping information from The TME provider uses the API of [TME](https://www.tme.eu/) to search for parts and get shopping information from
them. them.
To use it you have to create an account at TME and get an API key on the [TME API page](https://developers.tme.eu/en/). To use it you have to create an account at TME and get an API key on the [TME API page](https://developers.tme.eu/en/).
You have to generate a new anonymous key there and enter the key and secret in the Part-DB env configuration (see You have to generate a new anonymous key there and enter the key and secret in the Part-DB env configuration (see
@ -176,10 +176,10 @@ The following env configuration options are available:
### Farnell / Element14 / Newark ### Farnell / Element14 / Newark
The Farnell provider uses the [Farnell API](https://partner.element14.com/) to search for parts and getting shopping The Farnell provider uses the [Farnell API](https://partner.element14.com/) to search for parts and get shopping
information from [Farnell](https://www.farnell.com/). information from [Farnell](https://www.farnell.com/).
You have to create an account at Farnell and get an API key on the [Farnell API page](https://partner.element14.com/). You have to create an account at Farnell and get an API key on the [Farnell API page](https://partner.element14.com/).
Register a new application there (settings does not matter, as long as you select the "Product Search API") and you will Register a new application there (settings do not matter, as long as you select the "Product Search API") and you will
get an API key. get an API key.
The following env configuration options are available: The following env configuration options are available:
@ -191,7 +191,7 @@ The following env configuration options are available:
### Mouser ### Mouser
The Mouser provider uses the [Mouser API](https://www.mouser.de/api-home/) to search for parts and getting shopping The Mouser provider uses the [Mouser API](https://www.mouser.de/api-home/) to search for parts and get shopping
information from [Mouser](https://www.mouser.com/). information from [Mouser](https://www.mouser.com/).
You have to create an account at Mouser and register for an API key for the Search API on You have to create an account at Mouser and register for an API key for the Search API on
the [Mouser API page](https://www.mouser.de/api-home/). the [Mouser API page](https://www.mouser.de/api-home/).
@ -226,7 +226,7 @@ An API key is not required, it is enough to enable the provider using the follow
### OEMsecrets ### OEMsecrets
The oemsecrets provider uses the [oemsecrets API](https://www.oemsecrets.com/) to search for parts and getting shopping The oemsecrets provider uses the [oemsecrets API](https://www.oemsecrets.com/) to search for parts and get shopping
information from them. Similar to octopart it aggregates offers from different distributors. information from them. Similar to octopart it aggregates offers from different distributors.
You can apply for a free API key on the [oemsecrets API page](https://www.oemsecrets.com/api/) and put the key you get You can apply for a free API key on the [oemsecrets API page](https://www.oemsecrets.com/api/) and put the key you get

View file

@ -6,7 +6,7 @@ parent: Usage
# Labels # Labels
Part-DB support the generation and printing of labels for parts, part lots and storage locations. Part-DB supports the generation and printing of labels for parts, part lots and storage locations.
You can use the "Tools -> Label generator" menu entry to create labels or click the label generation link on the part. You can use the "Tools -> Label generator" menu entry to create labels or click the label generation link on the part.
You can define label templates by creating Label profiles. This way you can create many similar-looking labels with for You can define label templates by creating Label profiles. This way you can create many similar-looking labels with for

View file

@ -88,9 +88,9 @@ the user as "owner" of a part lot. This way, only he is allowed to add or remove
## Update notifications ## Update notifications
Part-DB can show you a notification that there is a newer version than currently installed available. The notification Part-DB can show you a notification that there is a newer version than currently installed. The notification
will be shown on the homepage and the server info page. will be shown on the homepage and the server info page.
It is only be shown to users which has the `Show available Part-DB updates` permission. It is only shown to users which have the `Show available Part-DB updates` permission.
For the notification to work, Part-DB queries the GitHub API every 2 days to check for new releases. No data is sent to For the notification to work, Part-DB queries the GitHub API every 2 days to check for new releases. No data is sent to
GitHub besides the metadata required for the connection (so the public IP address of your computer running Part-DB). GitHub besides the metadata required for the connection (so the public IP address of your computer running Part-DB).
@ -98,6 +98,6 @@ If you don't want Part-DB to query the GitHub API, or if your server can not rea
update notifications by setting the `CHECK_FOR_UPDATES` option to `false`. update notifications by setting the `CHECK_FOR_UPDATES` option to `false`.
## Internet access via proxy ## Internet access via proxy
If you server running Part-DB does not have direct access to the internet, but has to use a proxy server, you can configure If your server running Part-DB does not have direct access to the internet, but has to use a proxy server, you can configure
the proxy settings in the `.env.local` file (or docker env config). You can set the `HTTP_PROXY` and `HTTPS_PROXY` environment the proxy settings in the `.env.local` file (or docker env config). You can set the `HTTP_PROXY` and `HTTPS_PROXY` environment
variables to the URL of your proxy server. If your proxy server requires authentication, you can include the username and password in the URL. variables to the URL of your proxy server. If your proxy server requires authentication, you can include the username and password in the URL.

View file

@ -0,0 +1,156 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Migration\AbstractMultiPlatformMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20251204215443 extends AbstractMultiPlatformMigration
{
public function getDescription(): string
{
return 'Increase URL field lengths to 2048 characters';
}
public function mySQLUp(Schema $schema): void
{
$this->addSql('ALTER TABLE attachments CHANGE external_path external_path VARCHAR(2048) DEFAULT NULL');
$this->addSql('ALTER TABLE manufacturers CHANGE website website VARCHAR(2048) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(2048) NOT NULL');
$this->addSql('ALTER TABLE parts CHANGE provider_reference_provider_url provider_reference_provider_url VARCHAR(2048) DEFAULT NULL');
$this->addSql('ALTER TABLE suppliers CHANGE website website VARCHAR(2048) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(2048) NOT NULL');
}
public function mySQLDown(Schema $schema): void
{
$this->addSql('ALTER TABLE `attachments` CHANGE external_path external_path VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE `manufacturers` CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE `parts` CHANGE provider_reference_provider_url provider_reference_provider_url VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE `suppliers` CHANGE website website VARCHAR(255) NOT NULL, CHANGE auto_product_url auto_product_url VARCHAR(255) NOT NULL');
}
public function sqLiteUp(Schema $schema): void
{
$this->addSql('CREATE TEMPORARY TABLE __temp__attachments AS SELECT id, type_id, original_filename, show_in_table, name, last_modified, datetime_added, class_name, element_id, internal_path, external_path FROM attachments');
$this->addSql('DROP TABLE attachments');
$this->addSql('CREATE TABLE attachments (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type_id INTEGER NOT NULL, original_filename VARCHAR(255) DEFAULT NULL, show_in_table BOOLEAN NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, class_name VARCHAR(255) NOT NULL, element_id INTEGER NOT NULL, internal_path VARCHAR(255) DEFAULT NULL, external_path VARCHAR(2048) DEFAULT NULL, CONSTRAINT FK_47C4FAD6C54C8C93 FOREIGN KEY (type_id) REFERENCES attachment_types (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO attachments (id, type_id, original_filename, show_in_table, name, last_modified, datetime_added, class_name, element_id, internal_path, external_path) SELECT id, type_id, original_filename, show_in_table, name, last_modified, datetime_added, class_name, element_id, internal_path, external_path FROM __temp__attachments');
$this->addSql('DROP TABLE __temp__attachments');
$this->addSql('CREATE INDEX attachment_element_idx ON attachments (class_name, element_id)');
$this->addSql('CREATE INDEX attachment_name_idx ON attachments (name)');
$this->addSql('CREATE INDEX attachments_idx_class_name_id ON attachments (class_name, id)');
$this->addSql('CREATE INDEX attachments_idx_id_element_id_class_name ON attachments (id, element_id, class_name)');
$this->addSql('CREATE INDEX IDX_47C4FAD6C54C8C93 ON attachments (type_id)');
$this->addSql('CREATE INDEX IDX_47C4FAD61F1F2A24 ON attachments (element_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__manufacturers AS SELECT id, parent_id, id_preview_attachment, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names FROM manufacturers');
$this->addSql('DROP TABLE manufacturers');
$this->addSql('CREATE TABLE manufacturers (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, parent_id INTEGER DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL, address VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, fax_number VARCHAR(255) NOT NULL, email_address VARCHAR(255) NOT NULL, website VARCHAR(2048) NOT NULL, auto_product_url VARCHAR(2048) NOT NULL, comment CLOB NOT NULL, not_selectable BOOLEAN NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, alternative_names CLOB DEFAULT NULL, CONSTRAINT FK_94565B12727ACA70 FOREIGN KEY (parent_id) REFERENCES manufacturers (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_94565B12EA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES attachments (id) ON UPDATE NO ACTION ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO manufacturers (id, parent_id, id_preview_attachment, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names) SELECT id, parent_id, id_preview_attachment, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names FROM __temp__manufacturers');
$this->addSql('DROP TABLE __temp__manufacturers');
$this->addSql('CREATE INDEX IDX_94565B12EA7100A1 ON manufacturers (id_preview_attachment)');
$this->addSql('CREATE INDEX IDX_94565B12727ACA70 ON manufacturers (parent_id)');
$this->addSql('CREATE INDEX manufacturer_name ON manufacturers (name)');
$this->addSql('CREATE INDEX manufacturer_idx_parent_name ON manufacturers (parent_id, name)');
$this->addSql('CREATE TEMPORARY TABLE __temp__parts AS SELECT id, id_preview_attachment, id_category, id_footprint, id_part_unit, id_manufacturer, id_part_custom_state, order_orderdetails_id, built_project_id, datetime_added, name, last_modified, needs_review, tags, mass, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, ipn, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint FROM parts');
$this->addSql('DROP TABLE parts');
$this->addSql('CREATE TABLE parts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, id_preview_attachment INTEGER DEFAULT NULL, id_category INTEGER NOT NULL, id_footprint INTEGER DEFAULT NULL, id_part_unit INTEGER DEFAULT NULL, id_manufacturer INTEGER DEFAULT NULL, id_part_custom_state INTEGER DEFAULT NULL, order_orderdetails_id INTEGER DEFAULT NULL, built_project_id INTEGER DEFAULT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, needs_review BOOLEAN NOT NULL, tags CLOB NOT NULL, mass DOUBLE PRECISION DEFAULT NULL, description CLOB NOT NULL, comment CLOB NOT NULL, visible BOOLEAN NOT NULL, favorite BOOLEAN NOT NULL, minamount DOUBLE PRECISION NOT NULL, manufacturer_product_url CLOB NOT NULL, manufacturer_product_number VARCHAR(255) NOT NULL, manufacturing_status VARCHAR(255) DEFAULT NULL, order_quantity INTEGER NOT NULL, manual_order BOOLEAN NOT NULL, ipn VARCHAR(100) DEFAULT NULL, provider_reference_provider_key VARCHAR(255) DEFAULT NULL, provider_reference_provider_id VARCHAR(255) DEFAULT NULL, provider_reference_provider_url VARCHAR(2048) DEFAULT NULL, provider_reference_last_updated DATETIME DEFAULT NULL, eda_info_reference_prefix VARCHAR(255) DEFAULT NULL, eda_info_value VARCHAR(255) DEFAULT NULL, eda_info_invisible BOOLEAN DEFAULT NULL, eda_info_exclude_from_bom BOOLEAN DEFAULT NULL, eda_info_exclude_from_board BOOLEAN DEFAULT NULL, eda_info_exclude_from_sim BOOLEAN DEFAULT NULL, eda_info_kicad_symbol VARCHAR(255) DEFAULT NULL, eda_info_kicad_footprint VARCHAR(255) DEFAULT NULL, CONSTRAINT FK_6940A7FEEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES attachments (id) ON UPDATE NO ACTION ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES categories (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE7E371A10 FOREIGN KEY (id_footprint) REFERENCES footprints (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES measurement_units (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE1ECB93AE FOREIGN KEY (id_manufacturer) REFERENCES manufacturers (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEA3ED1215 FOREIGN KEY (id_part_custom_state) REFERENCES part_custom_states (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE81081E9B FOREIGN KEY (order_orderdetails_id) REFERENCES orderdetails (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEE8AE70D9 FOREIGN KEY (built_project_id) REFERENCES projects (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO parts (id, id_preview_attachment, id_category, id_footprint, id_part_unit, id_manufacturer, id_part_custom_state, order_orderdetails_id, built_project_id, datetime_added, name, last_modified, needs_review, tags, mass, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, ipn, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint) SELECT id, id_preview_attachment, id_category, id_footprint, id_part_unit, id_manufacturer, id_part_custom_state, order_orderdetails_id, built_project_id, datetime_added, name, last_modified, needs_review, tags, mass, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, ipn, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint FROM __temp__parts');
$this->addSql('DROP TABLE __temp__parts');
$this->addSql('CREATE INDEX IDX_6940A7FEA3ED1215 ON parts (id_part_custom_state)');
$this->addSql('CREATE INDEX IDX_6940A7FE1ECB93AE ON parts (id_manufacturer)');
$this->addSql('CREATE INDEX IDX_6940A7FE2626CEF9 ON parts (id_part_unit)');
$this->addSql('CREATE INDEX IDX_6940A7FE5697F554 ON parts (id_category)');
$this->addSql('CREATE INDEX IDX_6940A7FE7E371A10 ON parts (id_footprint)');
$this->addSql('CREATE INDEX IDX_6940A7FEEA7100A1 ON parts (id_preview_attachment)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE3D721C14 ON parts (ipn)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE81081E9B ON parts (order_orderdetails_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FEE8AE70D9 ON parts (built_project_id)');
$this->addSql('CREATE INDEX parts_idx_datet_name_last_id_needs ON parts (datetime_added, name, last_modified, id, needs_review)');
$this->addSql('CREATE INDEX parts_idx_ipn ON parts (ipn)');
$this->addSql('CREATE INDEX parts_idx_name ON parts (name)');
$this->addSql('CREATE TEMPORARY TABLE __temp__suppliers AS SELECT id, parent_id, default_currency_id, id_preview_attachment, shipping_costs, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names FROM suppliers');
$this->addSql('DROP TABLE suppliers');
$this->addSql('CREATE TABLE suppliers (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, parent_id INTEGER DEFAULT NULL, default_currency_id INTEGER DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL, shipping_costs NUMERIC(11, 5) DEFAULT NULL, address VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, fax_number VARCHAR(255) NOT NULL, email_address VARCHAR(255) NOT NULL, website VARCHAR(2048) NOT NULL, auto_product_url VARCHAR(2048) NOT NULL, comment CLOB NOT NULL, not_selectable BOOLEAN NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, alternative_names CLOB DEFAULT NULL, CONSTRAINT FK_AC28B95C727ACA70 FOREIGN KEY (parent_id) REFERENCES suppliers (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_AC28B95CECD792C0 FOREIGN KEY (default_currency_id) REFERENCES currencies (id) ON UPDATE NO ACTION ON DELETE NO ACTION NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_AC28B95CEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES attachments (id) ON UPDATE NO ACTION ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO suppliers (id, parent_id, default_currency_id, id_preview_attachment, shipping_costs, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names) SELECT id, parent_id, default_currency_id, id_preview_attachment, shipping_costs, address, phone_number, fax_number, email_address, website, auto_product_url, comment, not_selectable, name, last_modified, datetime_added, alternative_names FROM __temp__suppliers');
$this->addSql('DROP TABLE __temp__suppliers');
$this->addSql('CREATE INDEX IDX_AC28B95CECD792C0 ON suppliers (default_currency_id)');
$this->addSql('CREATE INDEX IDX_AC28B95C727ACA70 ON suppliers (parent_id)');
$this->addSql('CREATE INDEX supplier_idx_name ON suppliers (name)');
$this->addSql('CREATE INDEX supplier_idx_parent_name ON suppliers (parent_id, name)');
$this->addSql('CREATE INDEX IDX_AC28B95CEA7100A1 ON suppliers (id_preview_attachment)');
}
public function sqLiteDown(Schema $schema): void
{
$this->addSql('CREATE TEMPORARY TABLE __temp__attachments AS SELECT id, name, last_modified, datetime_added, original_filename, internal_path, external_path, show_in_table, type_id, class_name, element_id FROM "attachments"');
$this->addSql('DROP TABLE "attachments"');
$this->addSql('CREATE TABLE "attachments" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, original_filename VARCHAR(255) DEFAULT NULL, internal_path VARCHAR(255) DEFAULT NULL, external_path VARCHAR(255) DEFAULT NULL, show_in_table BOOLEAN NOT NULL, type_id INTEGER NOT NULL, class_name VARCHAR(255) NOT NULL, element_id INTEGER NOT NULL, CONSTRAINT FK_47C4FAD6C54C8C93 FOREIGN KEY (type_id) REFERENCES "attachment_types" (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO "attachments" (id, name, last_modified, datetime_added, original_filename, internal_path, external_path, show_in_table, type_id, class_name, element_id) SELECT id, name, last_modified, datetime_added, original_filename, internal_path, external_path, show_in_table, type_id, class_name, element_id FROM __temp__attachments');
$this->addSql('DROP TABLE __temp__attachments');
$this->addSql('CREATE INDEX IDX_47C4FAD6C54C8C93 ON "attachments" (type_id)');
$this->addSql('CREATE INDEX IDX_47C4FAD61F1F2A24 ON "attachments" (element_id)');
$this->addSql('CREATE INDEX attachments_idx_id_element_id_class_name ON "attachments" (id, element_id, class_name)');
$this->addSql('CREATE INDEX attachments_idx_class_name_id ON "attachments" (class_name, id)');
$this->addSql('CREATE INDEX attachment_name_idx ON "attachments" (name)');
$this->addSql('CREATE INDEX attachment_element_idx ON "attachments" (class_name, element_id)');
$this->addSql('CREATE TEMPORARY TABLE __temp__manufacturers AS SELECT id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, parent_id, id_preview_attachment FROM "manufacturers"');
$this->addSql('DROP TABLE "manufacturers"');
$this->addSql('CREATE TABLE "manufacturers" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, comment CLOB NOT NULL, not_selectable BOOLEAN NOT NULL, alternative_names CLOB DEFAULT NULL, address VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, fax_number VARCHAR(255) NOT NULL, email_address VARCHAR(255) NOT NULL, website VARCHAR(255) NOT NULL, auto_product_url VARCHAR(255) NOT NULL, parent_id INTEGER DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL, CONSTRAINT FK_94565B12727ACA70 FOREIGN KEY (parent_id) REFERENCES "manufacturers" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_94565B12EA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES "attachments" (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO "manufacturers" (id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, parent_id, id_preview_attachment) SELECT id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, parent_id, id_preview_attachment FROM __temp__manufacturers');
$this->addSql('DROP TABLE __temp__manufacturers');
$this->addSql('CREATE INDEX IDX_94565B12727ACA70 ON "manufacturers" (parent_id)');
$this->addSql('CREATE INDEX IDX_94565B12EA7100A1 ON "manufacturers" (id_preview_attachment)');
$this->addSql('CREATE INDEX manufacturer_name ON "manufacturers" (name)');
$this->addSql('CREATE INDEX manufacturer_idx_parent_name ON "manufacturers" (parent_id, name)');
$this->addSql('CREATE TEMPORARY TABLE __temp__parts AS SELECT id, name, last_modified, datetime_added, needs_review, tags, mass, ipn, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint, id_preview_attachment, id_part_custom_state, id_category, id_footprint, id_part_unit, id_manufacturer, order_orderdetails_id, built_project_id FROM "parts"');
$this->addSql('DROP TABLE "parts"');
$this->addSql('CREATE TABLE "parts" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, needs_review BOOLEAN NOT NULL, tags CLOB NOT NULL, mass DOUBLE PRECISION DEFAULT NULL, ipn VARCHAR(100) DEFAULT NULL, description CLOB NOT NULL, comment CLOB NOT NULL, visible BOOLEAN NOT NULL, favorite BOOLEAN NOT NULL, minamount DOUBLE PRECISION NOT NULL, manufacturer_product_url CLOB NOT NULL, manufacturer_product_number VARCHAR(255) NOT NULL, manufacturing_status VARCHAR(255) DEFAULT NULL, order_quantity INTEGER NOT NULL, manual_order BOOLEAN NOT NULL, provider_reference_provider_key VARCHAR(255) DEFAULT NULL, provider_reference_provider_id VARCHAR(255) DEFAULT NULL, provider_reference_provider_url VARCHAR(255) DEFAULT NULL, provider_reference_last_updated DATETIME DEFAULT NULL, eda_info_reference_prefix VARCHAR(255) DEFAULT NULL, eda_info_value VARCHAR(255) DEFAULT NULL, eda_info_invisible BOOLEAN DEFAULT NULL, eda_info_exclude_from_bom BOOLEAN DEFAULT NULL, eda_info_exclude_from_board BOOLEAN DEFAULT NULL, eda_info_exclude_from_sim BOOLEAN DEFAULT NULL, eda_info_kicad_symbol VARCHAR(255) DEFAULT NULL, eda_info_kicad_footprint VARCHAR(255) DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL, id_part_custom_state INTEGER DEFAULT NULL, id_category INTEGER NOT NULL, id_footprint INTEGER DEFAULT NULL, id_part_unit INTEGER DEFAULT NULL, id_manufacturer INTEGER DEFAULT NULL, order_orderdetails_id INTEGER DEFAULT NULL, built_project_id INTEGER DEFAULT NULL, CONSTRAINT FK_6940A7FEEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES "attachments" (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEA3ED1215 FOREIGN KEY (id_part_custom_state) REFERENCES "part_custom_states" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES "categories" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE7E371A10 FOREIGN KEY (id_footprint) REFERENCES "footprints" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES "measurement_units" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE1ECB93AE FOREIGN KEY (id_manufacturer) REFERENCES "manufacturers" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE81081E9B FOREIGN KEY (order_orderdetails_id) REFERENCES "orderdetails" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEE8AE70D9 FOREIGN KEY (built_project_id) REFERENCES projects (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO "parts" (id, name, last_modified, datetime_added, needs_review, tags, mass, ipn, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint, id_preview_attachment, id_part_custom_state, id_category, id_footprint, id_part_unit, id_manufacturer, order_orderdetails_id, built_project_id) SELECT id, name, last_modified, datetime_added, needs_review, tags, mass, ipn, description, comment, visible, favorite, minamount, manufacturer_product_url, manufacturer_product_number, manufacturing_status, order_quantity, manual_order, provider_reference_provider_key, provider_reference_provider_id, provider_reference_provider_url, provider_reference_last_updated, eda_info_reference_prefix, eda_info_value, eda_info_invisible, eda_info_exclude_from_bom, eda_info_exclude_from_board, eda_info_exclude_from_sim, eda_info_kicad_symbol, eda_info_kicad_footprint, id_preview_attachment, id_part_custom_state, id_category, id_footprint, id_part_unit, id_manufacturer, order_orderdetails_id, built_project_id FROM __temp__parts');
$this->addSql('DROP TABLE __temp__parts');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE3D721C14 ON "parts" (ipn)');
$this->addSql('CREATE INDEX IDX_6940A7FEEA7100A1 ON "parts" (id_preview_attachment)');
$this->addSql('CREATE INDEX IDX_6940A7FEA3ED1215 ON "parts" (id_part_custom_state)');
$this->addSql('CREATE INDEX IDX_6940A7FE5697F554 ON "parts" (id_category)');
$this->addSql('CREATE INDEX IDX_6940A7FE7E371A10 ON "parts" (id_footprint)');
$this->addSql('CREATE INDEX IDX_6940A7FE2626CEF9 ON "parts" (id_part_unit)');
$this->addSql('CREATE INDEX IDX_6940A7FE1ECB93AE ON "parts" (id_manufacturer)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE81081E9B ON "parts" (order_orderdetails_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FEE8AE70D9 ON "parts" (built_project_id)');
$this->addSql('CREATE INDEX parts_idx_datet_name_last_id_needs ON "parts" (datetime_added, name, last_modified, id, needs_review)');
$this->addSql('CREATE INDEX parts_idx_name ON "parts" (name)');
$this->addSql('CREATE INDEX parts_idx_ipn ON "parts" (ipn)');
$this->addSql('CREATE TEMPORARY TABLE __temp__suppliers AS SELECT id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, shipping_costs, parent_id, default_currency_id, id_preview_attachment FROM "suppliers"');
$this->addSql('DROP TABLE "suppliers"');
$this->addSql('CREATE TABLE "suppliers" (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, comment CLOB NOT NULL, not_selectable BOOLEAN NOT NULL, alternative_names CLOB DEFAULT NULL, address VARCHAR(255) NOT NULL, phone_number VARCHAR(255) NOT NULL, fax_number VARCHAR(255) NOT NULL, email_address VARCHAR(255) NOT NULL, website VARCHAR(255) NOT NULL, auto_product_url VARCHAR(255) NOT NULL, shipping_costs NUMERIC(11, 5) DEFAULT NULL, parent_id INTEGER DEFAULT NULL, default_currency_id INTEGER DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL, CONSTRAINT FK_AC28B95C727ACA70 FOREIGN KEY (parent_id) REFERENCES "suppliers" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_AC28B95CECD792C0 FOREIGN KEY (default_currency_id) REFERENCES currencies (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_AC28B95CEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES "attachments" (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE)');
$this->addSql('INSERT INTO "suppliers" (id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, shipping_costs, parent_id, default_currency_id, id_preview_attachment) SELECT id, name, last_modified, datetime_added, comment, not_selectable, alternative_names, address, phone_number, fax_number, email_address, website, auto_product_url, shipping_costs, parent_id, default_currency_id, id_preview_attachment FROM __temp__suppliers');
$this->addSql('DROP TABLE __temp__suppliers');
$this->addSql('CREATE INDEX IDX_AC28B95C727ACA70 ON "suppliers" (parent_id)');
$this->addSql('CREATE INDEX IDX_AC28B95CECD792C0 ON "suppliers" (default_currency_id)');
$this->addSql('CREATE INDEX IDX_AC28B95CEA7100A1 ON "suppliers" (id_preview_attachment)');
$this->addSql('CREATE INDEX supplier_idx_name ON "suppliers" (name)');
$this->addSql('CREATE INDEX supplier_idx_parent_name ON "suppliers" (parent_id, name)');
}
public function postgreSQLUp(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE attachments ALTER external_path TYPE VARCHAR(2048)');
$this->addSql('ALTER TABLE manufacturers ALTER website TYPE VARCHAR(2048)');
$this->addSql('ALTER TABLE manufacturers ALTER auto_product_url TYPE VARCHAR(2048)');
$this->addSql('ALTER TABLE parts ALTER provider_reference_provider_url TYPE VARCHAR(2048)');
$this->addSql('ALTER TABLE suppliers ALTER website TYPE VARCHAR(2048)');
$this->addSql('ALTER TABLE suppliers ALTER auto_product_url TYPE VARCHAR(2048)');
}
public function postgreSQLDown(Schema $schema): void
{
$this->addSql('ALTER TABLE "attachments" ALTER external_path TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE "manufacturers" ALTER website TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE "manufacturers" ALTER auto_product_url TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE "parts" ALTER provider_reference_provider_url TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE "suppliers" ALTER website TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE "suppliers" ALTER auto_product_url TYPE VARCHAR(255)');
}
}

View file

@ -166,9 +166,10 @@ abstract class Attachment extends AbstractNamedDBElement
* @var string|null The path to the external source if the file is stored externally or was downloaded from an * @var string|null The path to the external source if the file is stored externally or was downloaded from an
* external source. Null if there is no external source. * external source. Null if there is no external source.
*/ */
#[ORM\Column(type: Types::STRING, nullable: true)] #[ORM\Column(type: Types::STRING, length: 2048, nullable: true)]
#[Groups(['attachment:read'])] #[Groups(['attachment:read'])]
#[ApiProperty(example: 'http://example.com/image.jpg')] #[ApiProperty(example: 'http://example.com/image.jpg')]
#[Assert\Length(2048)]
protected ?string $external_path = null; protected ?string $external_path = null;
/** /**
@ -551,8 +552,8 @@ abstract class Attachment extends AbstractNamedDBElement
*/ */
#[Groups(['attachment:write'])] #[Groups(['attachment:write'])]
#[SerializedName('url')] #[SerializedName('url')]
#[ApiProperty(description: 'Set the path of the attachment here. #[ApiProperty(description: 'Set the path of the attachment here.
Provide either an external URL, a path to a builtin file (like %FOOTPRINTS%/Active/ICs/IC_DFS.png) or an empty Provide either an external URL, a path to a builtin file (like %FOOTPRINTS%/Active/ICs/IC_DFS.png) or an empty
string if the attachment has an internal file associated and you\'d like to reset the external source. string if the attachment has an internal file associated and you\'d like to reset the external source.
If you set a new (nonempty) file path any associated internal file will be removed!')] If you set a new (nonempty) file path any associated internal file will be removed!')]
public function setURL(?string $url): self public function setURL(?string $url): self

View file

@ -83,8 +83,8 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
*/ */
#[Assert\Url(requireTld: false)] #[Assert\Url(requireTld: false)]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])] #[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)] #[ORM\Column(type: Types::STRING, length: 2048)]
#[Assert\Length(max: 255)] #[Assert\Length(max: 2048)]
protected string $website = ''; protected string $website = '';
#[Groups(['company:read', 'company:write', 'import', 'full', 'extended'])] #[Groups(['company:read', 'company:write', 'import', 'full', 'extended'])]
@ -93,8 +93,8 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/** /**
* @var string The link to the website of an article. Use %PARTNUMBER% as placeholder for the part number. * @var string The link to the website of an article. Use %PARTNUMBER% as placeholder for the part number.
*/ */
#[ORM\Column(type: Types::STRING)] #[ORM\Column(type: Types::STRING, length: 2048)]
#[Assert\Length(max: 255)] #[Assert\Length(max: 2048)]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])] #[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
protected string $auto_product_url = ''; protected string $auto_product_url = '';

View file

@ -50,7 +50,7 @@ class InfoProviderReference
/** /**
* @var string|null The url of this part inside the provider system or null if this info is not existing * @var string|null The url of this part inside the provider system or null if this info is not existing
*/ */
#[Column(type: Types::STRING, nullable: true)] #[Column(type: Types::STRING, length: 2048, nullable: true)]
#[Groups(['provider_reference:read', 'full'])] #[Groups(['provider_reference:read', 'full'])]
private ?string $provider_url = null; private ?string $provider_url = null;
@ -157,4 +157,4 @@ class InfoProviderReference
$ref->last_updated = new \DateTimeImmutable(); $ref->last_updated = new \DateTimeImmutable();
return $ref; return $ref;
} }
} }

View file

@ -0,0 +1,49 @@
<?php
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace App\EnvVarProcessors;
use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
/**
* Env var processor that adds a trailing slash to a string if not already present.
*/
final class AddSlashEnvVarProcessor implements EnvVarProcessorInterface
{
public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
{
$env = $getEnv($name);
if (!is_string($env)) {
throw new \InvalidArgumentException(sprintf('The "addSlash" env var processor only works with strings, got %s.', gettype($env)));
}
return rtrim($env, '/') . '/';
}
public static function getProvidedTypes(): array
{
return [
'addSlash' => 'string',
];
}
}

View file

@ -20,7 +20,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace App\Services; namespace App\EnvVarProcessors;
use Closure; use Closure;
use Symfony\Component\DependencyInjection\EnvVarProcessorInterface; use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;

View file

@ -0,0 +1,44 @@
<?php
/*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
*
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace App\Tests\EnvVarProcessors;
use App\EnvVarProcessors\AddSlashEnvVarProcessor;
use PHPUnit\Framework\TestCase;
class AddSlashEnvVarProcessorTest extends TestCase
{
protected AddSlashEnvVarProcessor $processor;
protected function setUp(): void
{
$this->processor = new AddSlashEnvVarProcessor();
}
public function testGetEnv(): void
{
$getEnv = function ($name) {
return $name;
};
$this->assertEquals('http://example.com/', $this->processor->getEnv('addSlash', 'http://example.com', $getEnv));
$this->assertEquals('http://example.com/', $this->processor->getEnv('addSlash', 'http://example.com/', $getEnv));
}
}

View file

@ -14318,7 +14318,7 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
<unit id="CPwXFjE" name="info_providers.bulk_import.priority_system.description"> <unit id="CPwXFjE" name="info_providers.bulk_import.priority_system.description">
<segment state="translated"> <segment state="translated">
<source>info_providers.bulk_import.priority_system.description</source> <source>info_providers.bulk_import.priority_system.description</source>
<target>Lower numbers = higher priority. Same priority = combine results. Different priorities = try highest first, fallback if no results.</target> <target>Niedrigere Zahlen = höhere Priorität. Gleiche Priorität = Ergebnisse kombinieren. Unterschiedliche Prioritäten = zuerst die höchste versuchen, bei fehlenden Ergebnissen auf die niedrigere zurückgreifen.</target>
</segment> </segment>
</unit> </unit>
<unit id="v.rTI5s" name="info_providers.bulk_import.priority_system.example"> <unit id="v.rTI5s" name="info_providers.bulk_import.priority_system.example">
@ -14436,5 +14436,252 @@ Dies ist auf der Informationsquellen Übersichtsseite möglich.</target>
<target>Wenn aktiviert, wird die Bauteil-Beschreibung verwendet, um vorhandene Teile mit derselben Beschreibung zu finden und die nächste verfügbare IPN für die Vorschlagsliste zu ermitteln, indem der numerische Suffix entsprechend erhöht wird.</target> <target>Wenn aktiviert, wird die Bauteil-Beschreibung verwendet, um vorhandene Teile mit derselben Beschreibung zu finden und die nächste verfügbare IPN für die Vorschlagsliste zu ermitteln, indem der numerische Suffix entsprechend erhöht wird.</target>
</segment> </segment>
</unit> </unit>
<unit id="NIw6dtz" name="settings.misc.ipn_suggest.regex.help">
<segment>
<source>settings.misc.ipn_suggest.regex.help</source>
<target>Ein PCRE-kompatibler regulärer Ausdruck, den jede IPN erfüllen muss. Leer lassen, um alles als IPN zu erlauben.</target>
</segment>
</unit>
<unit id="MoHHSNT" name="user.labelp">
<segment>
<source>user.labelp</source>
<target>Benutzer</target>
</segment>
</unit>
<unit id="5.oI1XD" name="currency.labelp">
<segment>
<source>currency.labelp</source>
<target>Währungen</target>
</segment>
</unit>
<unit id="8F2EwVK" name="measurement_unit.labelp">
<segment>
<source>measurement_unit.labelp</source>
<target>Maßeinheiten</target>
</segment>
</unit>
<unit id="hYrcka2" name="attachment_type.labelp">
<segment>
<source>attachment_type.labelp</source>
<target>Dateitypen</target>
</segment>
</unit>
<unit id="p.Sjja3" name="label_profile.labelp">
<segment>
<source>label_profile.labelp</source>
<target>Labelprofile</target>
</segment>
</unit>
<unit id="Y_ISV0y" name="part_custom_state.labelp">
<segment>
<source>part_custom_state.labelp</source>
<target>Benutzerdefinierte Bauteilstatus</target>
</segment>
</unit>
<unit id="aXr7mN." name="group.labelp">
<segment>
<source>group.labelp</source>
<target>Gruppen</target>
</segment>
</unit>
<unit id="O10voez" name="settings.synonyms.type_synonym.type">
<segment>
<source>settings.synonyms.type_synonym.type</source>
<target>Typ</target>
</segment>
</unit>
<unit id="1BDQVEp" name="settings.synonyms.type_synonym.language">
<segment>
<source>settings.synonyms.type_synonym.language</source>
<target>Sprache</target>
</segment>
</unit>
<unit id="2.g2ewQ" name="settings.synonyms.type_synonym.translation_singular">
<segment>
<source>settings.synonyms.type_synonym.translation_singular</source>
<target>Übersetzung Singular</target>
</segment>
</unit>
<unit id="Up9ZhvR" name="settings.synonyms.type_synonym.translation_plural">
<segment>
<source>settings.synonyms.type_synonym.translation_plural</source>
<target>Übersetzung Plural</target>
</segment>
</unit>
<unit id="BHoS230" name="settings.synonyms.type_synonym.add_entry">
<segment>
<source>settings.synonyms.type_synonym.add_entry</source>
<target>Eintrag hinzufügen</target>
</segment>
</unit>
<unit id="wvtOEBn" name="settings.synonyms.type_synonym.remove_entry">
<segment>
<source>settings.synonyms.type_synonym.remove_entry</source>
<target>Eintrag entfernen</target>
</segment>
</unit>
<unit id="mLu.2F2" name="settings.synonyms">
<segment>
<source>settings.synonyms</source>
<target>Synonyme</target>
</segment>
</unit>
<unit id="SHgc9i." name="settings.synonyms.help">
<segment>
<source>settings.synonyms.help</source>
<target>Das Synonymsystem ermöglicht es, zu überschreiben, wie Part-DB bestimmte Dinge benennt. Dies kann nützlich sein, insbesondere wenn Part-DB in einem anderen Kontext als Elektronik verwendet wird.
Bitte beachten Sie, dass dieses System derzeit experimentell ist und die hier definierten Synonyme möglicherweise nicht an allen Stellen angezeigt werden.</target>
</segment>
</unit>
<unit id="piB78W5" name="settings.synonyms.type_synonyms">
<segment>
<source>settings.synonyms.type_synonyms</source>
<target>Typsynonyme</target>
</segment>
</unit>
<unit id="J8T2HuD" name="settings.synonyms.type_synonyms.help">
<segment>
<source>settings.synonyms.type_synonyms.help</source>
<target>Mit Typsynonymen können Sie die Bezeichnungen von integrierten Datentypen ersetzen. Zum Beispiel können Sie „Footprint" in etwas anderes umbenennen.</target>
</segment>
</unit>
<unit id="GSqBiVV" name="{{part}}">
<segment>
<source>{{part}}</source>
<target>Bauteile</target>
</segment>
</unit>
<unit id="wjcsjzT" name="log.element_edited.changed_fields.part_ipn_prefix">
<segment>
<source>log.element_edited.changed_fields.part_ipn_prefix</source>
<target>IPN-Präfix</target>
</segment>
</unit>
<unit id="R4hoCqe" name="part.labelp">
<segment>
<source>part.labelp</source>
<target>Bauteile</target>
</segment>
</unit>
<unit id=".tjK0ju" name="project_bom_entry.labelp">
<segment>
<source>project_bom_entry.labelp</source>
<target>BOM-Einträge</target>
</segment>
</unit>
<unit id="ftBf11d" name="part_lot.labelp">
<segment>
<source>part_lot.labelp</source>
<target>Bauteilbestände</target>
</segment>
</unit>
<unit id="UVDJmYp" name="orderdetail.labelp">
<segment>
<source>orderdetail.labelp</source>
<target>Bestellinformationen</target>
</segment>
</unit>
<unit id="83AQqv." name="pricedetail.labelp">
<segment>
<source>pricedetail.labelp</source>
<target>Preisinformationen</target>
</segment>
</unit>
<unit id="4KRV2mB" name="parameter.labelp">
<segment>
<source>parameter.labelp</source>
<target>Parameter</target>
</segment>
</unit>
<unit id="AAYYeiw" name="part_association.labelp">
<segment>
<source>part_association.labelp</source>
<target>Bauteilzuordnungen</target>
</segment>
</unit>
<unit id="2_3Lz7i" name="bulk_info_provider_import_job.labelp">
<segment>
<source>bulk_info_provider_import_job.labelp</source>
<target>Massenimporte von Informationsquellen</target>
</segment>
</unit>
<unit id="BXTqi16" name="bulk_info_provider_import_job_part.labelp">
<segment>
<source>bulk_info_provider_import_job_part.labelp</source>
<target>Massenimportauftrag Bauteil</target>
</segment>
</unit>
<unit id="91Wvg.F" name="password_toggle.hide">
<segment>
<source>password_toggle.hide</source>
<target>Ausblenden</target>
</segment>
</unit>
<unit id="2vciZN7" name="password_toggle.show">
<segment>
<source>password_toggle.show</source>
<target>Anzeigen</target>
</segment>
</unit>
<unit id="PVw6Lx4" name="settings.misc.ipn_suggest.regex.help.placeholder">
<segment>
<source>settings.misc.ipn_suggest.regex.help.placeholder</source>
<target>z.B. Format: 34 alphanumerische Segmente getrennt durch „-", gefolgt von „-" und 4 Ziffern, z.B. PCOM-RES-0001</target>
</segment>
</unit>
<unit id="M5Q_eZW" name="part.edit.tab.advanced.ipn.prefix.global_prefix">
<segment>
<source>part.edit.tab.advanced.ipn.prefix.global_prefix</source>
<target>Das globale IPN-Präfix, das für alle Bauteile gilt</target>
</segment>
</unit>
<unit id="WlKvQeB" name="settings.misc.ipn_suggest.fallbackPrefix">
<segment>
<source>settings.misc.ipn_suggest.fallbackPrefix</source>
<target>Fallback-Präfix</target>
</segment>
</unit>
<unit id="Fr8hXdE" name="settings.misc.ipn_suggest.fallbackPrefix.help">
<segment>
<source>settings.misc.ipn_suggest.fallbackPrefix.help</source>
<target>Das IPN-Präfix, das verwendet werden soll, wenn eine Kategorie kein Präfix definiert hat.</target>
</segment>
</unit>
<unit id="_p9cMpI" name="settings.misc.ipn_suggest.numberSeparator">
<segment>
<source>settings.misc.ipn_suggest.numberSeparator</source>
<target>Nummerntrennzeichen</target>
</segment>
</unit>
<unit id="CqfzuM6" name="settings.misc.ipn_suggest.numberSeparator.help">
<segment>
<source>settings.misc.ipn_suggest.numberSeparator.help</source>
<target>Das Trennzeichen, das verwendet wird, um die IPN-Nummer vom Präfix zu trennen.</target>
</segment>
</unit>
<unit id="PisGfwB" name="settings.misc.ipn_suggest.categorySeparator">
<segment>
<source>settings.misc.ipn_suggest.categorySeparator</source>
<target>Kategorietrennzeichen</target>
</segment>
</unit>
<unit id="jlNd0CI" name="settings.misc.ipn_suggest.categorySeparator.help">
<segment>
<source>settings.misc.ipn_suggest.categorySeparator.help</source>
<target>Das Trennzeichen, das verwendet wird, um verschiedene Ebenen von Kategoriepräfixen zu trennen.</target>
</segment>
</unit>
<unit id="MkiJuRK" name="settings.misc.ipn_suggest.globalPrefix">
<segment>
<source>settings.misc.ipn_suggest.globalPrefix</source>
<target>Globales Präfix</target>
</segment>
</unit>
<unit id="Akh9iFg" name="settings.misc.ipn_suggest.globalPrefix.help">
<segment>
<source>settings.misc.ipn_suggest.globalPrefix.help</source>
<target>Wenn aktiviert, wird eine Option zur Generierung einer IPN mit diesem globalen Präfix angeboten, das für Bauteile in allen Kategorien gilt.</target>
</segment>
</unit>
</file> </file>
</xliff> </xliff>

View file

@ -14288,7 +14288,7 @@ You can do this in the provider info list.</target>
<unit id="NIw6dtz" name="settings.misc.ipn_suggest.regex.help"> <unit id="NIw6dtz" name="settings.misc.ipn_suggest.regex.help">
<segment> <segment>
<source>settings.misc.ipn_suggest.regex.help</source> <source>settings.misc.ipn_suggest.regex.help</source>
<target>A PCRE-compatible regular expression every IPN has to fulfill. Leave empty to allow all everything as IPN. </target> <target>A PCRE-compatible regular expression every IPN has to fulfill. Leave empty to allow everything as IPN.</target>
</segment> </segment>
</unit> </unit>
<unit id="MoHHSNT" name="user.labelp"> <unit id="MoHHSNT" name="user.labelp">

View file

@ -4,7 +4,7 @@
<unit id="GrLNa9P" name="user.login_error.user_disabled"> <unit id="GrLNa9P" name="user.login_error.user_disabled">
<segment state="translated"> <segment state="translated">
<source>user.login_error.user_disabled</source> <source>user.login_error.user_disabled</source>
<target>Ihr Account ist deaktiviert! Kontaktiere einen Administrator, wenn Sie denken, dass dies ein Fehler ist.</target> <target>Ihr Account ist deaktiviert! Kontaktieren Sie einen Administrator, wenn Sie denken, dass dies ein Fehler ist.</target>
</segment> </segment>
</unit> </unit>
<unit id="IFQ5XrG" name="saml.error.cannot_login_local_user_per_saml"> <unit id="IFQ5XrG" name="saml.error.cannot_login_local_user_per_saml">

View file

@ -104,7 +104,7 @@
</notes> </notes>
<segment state="translated"> <segment state="translated">
<source>parameters.validator.min_lesser_typical</source> <source>parameters.validator.min_lesser_typical</source>
<target>Value must be lesser or equal the the typical value ({{ compared_value }}).</target> <target>Value must be less than or equal to the typical value ({{ compared_value }}).</target>
</segment> </segment>
</unit> </unit>
<unit id="Yfp2uC5" name="parameters.validator.min_lesser_max"> <unit id="Yfp2uC5" name="parameters.validator.min_lesser_max">
@ -124,7 +124,7 @@
</notes> </notes>
<segment state="translated"> <segment state="translated">
<source>parameters.validator.min_lesser_max</source> <source>parameters.validator.min_lesser_max</source>
<target>Value must be lesser than the maximum value ({{ compared_value }}).</target> <target>Value must be less than the maximum value ({{ compared_value }}).</target>
</segment> </segment>
</unit> </unit>
<unit id="P6b.8Ou" name="parameters.validator.max_greater_typical"> <unit id="P6b.8Ou" name="parameters.validator.max_greater_typical">
@ -144,7 +144,7 @@
</notes> </notes>
<segment state="translated"> <segment state="translated">
<source>parameters.validator.max_greater_typical</source> <source>parameters.validator.max_greater_typical</source>
<target>Value must be greater or equal than the typical value ({{ compared_value }}).</target> <target>Value must be greater than or equal to the typical value ({{ compared_value }}).</target>
</segment> </segment>
</unit> </unit>
<unit id="P41193Y" name="validator.user.username_already_used"> <unit id="P41193Y" name="validator.user.username_already_used">
@ -154,7 +154,7 @@
</notes> </notes>
<segment state="translated"> <segment state="translated">
<source>validator.user.username_already_used</source> <source>validator.user.username_already_used</source>
<target>A user with this name is already exisiting</target> <target>A user with this name already exists</target>
</segment> </segment>
</unit> </unit>
<unit id="EKPQiyf" name="user.invalid_username"> <unit id="EKPQiyf" name="user.invalid_username">