File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace LaravelEnso \Core \app \Commands \DatabaseUpgrades ;
4
+
5
+ use Illuminate \Support \Facades \Schema ;
6
+ use Illuminate \Database \Schema \Blueprint ;
7
+
8
+ class CompaniesFiscalCodeUpgrade extends DatabaseUpgrade
9
+ {
10
+ protected function isMigrated ()
11
+ {
12
+ return Schema::getConnection ()
13
+ ->getDoctrineSchemaManager ()
14
+ ->listTableDetails ('companies ' )
15
+ ->hasIndex ('companies_fiscal_code_unique ' );
16
+ }
17
+
18
+ public function migrateTable ()
19
+ {
20
+ Schema::table ('companies ' , function (Blueprint $ table ) {
21
+ $ table ->unique ('reg_com_nr ' );
22
+ $ table ->unique ('fiscal_code ' );
23
+ });
24
+ }
25
+ }
Original file line number Diff line number Diff line change 13
13
use LaravelEnso \Core \app \Commands \DatabaseUpgrades \InvoiceLineUpgrade ;
14
14
use LaravelEnso \Core \app \Commands \DatabaseUpgrades \RoAddressesUpgrade ;
15
15
use LaravelEnso \Core \app \Commands \DatabaseUpgrades \DataImportIndexUpgrade ;
16
+ use LaravelEnso \Core \app \Commands \DatabaseUpgrades \CompaniesFiscalCodeUpgrade ;
16
17
use LaravelEnso \Core \app \Commands \DatabaseUpgrades \AddingInvoiceLinePermissions ;
17
18
18
19
class Upgrade extends Command
@@ -41,5 +42,7 @@ private function upgrade()
41
42
(new InvoiceLineUpgrade ())->migrate ();
42
43
(new AddingInvoiceLinePermissions ())->migrate ();
43
44
}
45
+
46
+ //(new CompaniesFiscalCodeUpgrade())->handle();
44
47
}
45
48
}
You can’t perform that action at this time.
0 commit comments