فهرست منبع

Fix migration when table llx_asset is missing

Laurent Destailleur 2 سال پیش
والد
کامیت
bfd33c9157
2فایلهای تغییر یافته به همراه46 افزوده شده و 1 حذف شده
  1. 1 1
      README.md
  2. 45 0
      htdocs/install/mysql/migration/15.0.0-16.0.0.sql

+ 1 - 1
README.md

@@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read
 Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
 
 - At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr)
-- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md).
+- Check that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
 - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
 - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
   If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").

+ 45 - 0
htdocs/install/mysql/migration/15.0.0-16.0.0.sql

@@ -365,7 +365,52 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom
 -- Set default ticket type to OTHER if no default exists
 UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1);
 
+
 -- Assets - New module
+
+CREATE TABLE llx_asset(
+    rowid                   integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+    ref                     varchar(128)    NOT NULL,
+    entity                  integer         DEFAULT 1 NOT NULL,
+    label                   varchar(255),
+
+    fk_asset_model          integer,
+
+    reversal_amount_ht      double(24,8),
+    acquisition_value_ht    double(24,8)    DEFAULT NULL,
+    recovered_vat           double(24,8),
+
+    reversal_date           date,
+
+    date_acquisition        date            NOT NULL,
+    date_start              date            NOT NULL,
+
+    qty                     real            DEFAULT 1 NOT NULL,
+
+    acquisition_type        smallint        DEFAULT 0 NOT NULL,
+    asset_type              smallint        DEFAULT 0 NOT NULL,
+
+    not_depreciated         integer         DEFAULT 0,
+
+    disposal_date           date,
+    disposal_amount_ht      double(24,8),
+    fk_disposal_type        integer,
+    disposal_depreciated    integer         DEFAULT 0,
+    disposal_subject_to_vat integer         DEFAULT 0,
+
+    note_public             text,
+    note_private            text,
+
+    date_creation           datetime        NOT NULL,
+    tms                     timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+    fk_user_creat           integer         NOT NULL,
+    fk_user_modif           integer,
+    last_main_doc           varchar(255),
+    import_key              varchar(14),
+    model_pdf               varchar(255),
+    status                  integer         NOT NULL
+) ENGINE=innodb;
+
 ALTER TABLE llx_asset DROP FOREIGN KEY fk_asset_asset_type;
 ALTER TABLE llx_asset DROP INDEX idx_asset_fk_asset_type;