1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 18:04:03 +00:00
Commit graph

934 commits

Author SHA1 Message Date
PHP CS Fixer
9c584b8394 Fix code style (php-cs-fixer) 2022-08-02 02:21:33 +00:00
Samuel Štancl
e9b6de78b2 minor code updates 2022-08-02 04:21:03 +02:00
Samuel Štancl
d0baabbc9d Merge branch 'master' of github.com:archtechx/tenancy 2022-07-28 15:30:19 +02:00
Samuel Štancl
be13160133 wip Debuggable trait 2022-07-28 15:14:29 +02:00
Abrar Ahmad
29634dda84
added $this->mockConsoleOutput (#907) 2022-07-27 01:35:55 +02:00
beezerk23
233a1222bf
feat(UniversalRoutes): Stop overwriting the (maybe) customized onFail… (#679)
* feat(UniversalRoutes): Stop overwriting the (maybe) customized onFail method and just call it in case of an exception

* throw correct exception when `$originalOnFail()` is null

* Update DomainTest.php

* convert test to pest and renamed

* Update tests/DomainTest.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-07-25 18:37:52 +02:00
Samuel Štancl
f9c9d8615f Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
Samuel Štancl
05f2a828a1 Better M1 DX 2022-07-22 22:29:56 +02:00
Samuel Štancl
2f3d4b9953 Allow pest plugin 2022-07-22 19:48:56 +02:00
Samuel Štancl
b47c5549ef
[4.x] Migrate tests to Pest (#884)
* Add Pest dependencies

* Add base Pest file

* Convert test cases

* Remove non-compound imports

* Adopt expectation API

* Optimize uses

* Shift cleanup

* phpunit -> pest

* Fix tests in PR #884 PHPUnit to Pest Converter  (#885)

* fixed tests, remove method duplications, restore necessary inner classes

* Update CommandsTest.php

* temporary checks run on `shift-64622` on branch.

* fixed `TestSeeder` class not resolved

* fixed messed up names

* removed `uses` from individual files and add it in `Pest`

* extract tests to helpers

* use pest dataset

* Update AutomaticModeTest.php

* newline

* todo convention

* resolve reviews

* added `// todo@tests`

* remove shift branch from CI workflow

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* check if I have write permission

* Convert newly added tests to Pest

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
2022-07-22 19:26:59 +02:00
Abrar Ahmad
69de181b7d
removed PHP_CS_FIXER_IGNORE_ENV (#904) 2022-07-22 19:22:33 +02:00
PHP CS Fixer
c0f97fa04e Fix code style (php-cs-fixer) 2022-07-20 13:29:11 +00:00
Abrar Ahmad
97ab483173
Completing PR #881 (#902)
* install PHP CS Fixer

* Fix styling

* remove StyleCI config

* use config from archtechx/template

* Fix styling

* added `php-cs-fixer`

* Update .php-cs-fixer.php

* added GitHub token

* Update ci.yml

* Update ci.yml

* Update ci.yml

* php-cs-fixer workflow same as template

Co-authored-by: Erik Gaal <me@erikgaal.nl>
Co-authored-by: erikgaal <erikgaal@users.noreply.github.com>
2022-07-20 15:28:45 +02:00
Abrar Ahmad
627233d07a
[4.x] Don't use onDeleteCascade in the migrations (#883)
* removed `cascade` on delete for domains

* removed only `onDelete` cascade

* keep impersonation migrations unchanged

* domains set null on delete

* Update 2019_09_15_000020_create_domains_table.php

* Added DeleteDomain Job while deleting tenant.

* Update assets/TenancyServiceProvider.stub.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* renamed class

* Update DeleteDomains.php

* onDelete restrict

* revert nullable

* removed `shouldQueue` interface

* Update TenancyServiceProvider.stub.php

* fetch and delete domains individually

* Update DeleteDomains.php

* tests for `DeleteDomains` job

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-07-20 13:02:33 +02:00
Samuel Štancl
4aec6bfda2
add phpunit dependency 2022-06-28 21:47:33 +02:00
Nick Kitchen
cc6d4fe0dd
[4.x] Added support for Microsoft Sql Server (#715)
* added support for microsoft sql server database

* added support for microsoft sql server database

* trigger ci

* revert change

* trigger ci

* Try installing pdo_sqlsrv

* different approach for installing sqlsrv via pecl

* add dependencies

* add gnupg2

* Update Dockerfile

* try skipping msodbcsql17

* Update Dockerfile

* add dependency back

* update before installing

* try to add mssql

* mssql host

* TENANCY_TEST_MSSQL_HOST env var

* add env vars for mssql

* add sqlsrv vars to TestCase

* rename vars to SQLSRV [skip ci]

* MSSQL -> SQLSRV

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-06-23 13:04:53 +02:00
Samuel Štancl
72c41ea993
Discord link 2022-06-13 19:16:35 +02:00
Victor R
7d98ebb5d1
[4.x] Add tenant schema dump command (#807)
* Add tenant dump command

* Register tenant schema dump command

* Added tests for tenant schema dump command

* remove docblocks, fix tenant() logic

* trigger ci

* Install mysql-client

* mysql-client -> mariadb-client

* add tenant-schema-test.dump to .gitignore

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-06-01 16:12:59 +02:00
Samuel Štancl
d0de09aa53
remove old versions from CI 2022-06-01 15:36:46 +02:00
Samuel Štancl
eca7b336bc merge 3.x 2022-06-01 14:58:44 +02:00
Vincent GS
51228defc6
[3.x][Filesystem] Provide an additional argument for tenant name path (#817)
* Let the user pass the tenant suffix by %tenant%

In this PR we let the user pass an additional parameter using `%tenant%` so the user can additionally pass the folder corresponding to each tenant.
This is my proposal, because if I try to use %storage_path% within Linux, I get the full path to the project when I use Google Cloud Storage

* Missing missing updates

Moving from $subject to $root when %storage_path% has been replaced
2022-05-26 11:51:27 +02:00
Samuel Štancl
4d95e88e27 Revert "Resolve #854"
This reverts commit a1c3442148.
2022-05-15 13:45:54 +02:00
Samuel Štancl
a1c3442148
Resolve #854 2022-05-15 13:32:09 +02:00
Samuel Štancl
0569bf5a34
Update README.md 2022-05-01 12:56:25 +02:00
Nathan Dunn
40bf576e00
[3.x] Update PostgreSQLSchemaManager to set correct config key value (#840)
* Update PostgreSQLSchemaManager to set correct config key value

* Update to use version_compare

* Update TenantDatabaseManagerTest

* Improve TenantDatabaseManagerTest

* Update TenantDatabaseManager
2022-04-08 03:13:29 +02:00
Roy de Vos Burchart
f065ea60b0
Update QueueTenancyBootstrapper.php (#836) 2022-04-01 22:53:09 +02:00
Samuel Štancl
349125c02e
Merge hotfix branch (#834)
* try specifying the signature in __construct

* constructor doesn't work since Reflection is used, try specifying getDefaultName() instead

* Fixed: make migration commands compatible

* Fix failing tests

* Fix username generation

* Re-create tmp dir as well if needed

* wip
2022-03-30 18:00:55 +02:00
Samuel Štancl
4f19609797 remove docker-compose.override.yml 2022-03-23 20:58:47 +01:00
Samuel Štancl
4e717236f9 revert gitignore 2022-03-23 20:57:32 +01:00
Samuel Štancl
e1ae6f4380 re-add queuetest.json 2022-03-23 20:57:15 +01:00
Samuel Štancl
600bb823de avoid double // in prefix 2022-03-23 20:49:25 +01:00
Samuel Štancl
5026f54a6d fix path prefixing 2022-03-23 20:48:55 +01:00
Samuel Štancl
49ebb75f00
Fixes #827 2022-03-17 12:46:49 +01:00
Samuel Štancl
fa2a61fcd7
Use PHP 7.3 instead of 7.2 2022-03-17 12:30:14 +01:00
Samuel Štancl
eb1a2ebe32
Use 7.2 instead of 7.4 2022-03-17 12:24:57 +01:00
Erik Gaal
79e3d53b06
[3.x] Compatibility with Laravel 9 (#802)
* Test on Laravel 9

* Don't extend final Kernel class

* Make FilesystemTenancyBootstrapper compatible with Flysystem v3

Co-authored-by: George <jiri.zizka@funfirst.cz>

* Update tenant maintenance mode te be in line with Laravel

* Exclude PHP 7.4 <> L9 combination from testing

* add root_override-related assertions

* getPrefix -> getPathPrefix

* handle / inconsistency in s3 prefix

* Refactor Storage facade changes

Co-authored-by: George <jiri.zizka@funfirst.cz>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-03-08 01:50:25 +01:00
masiorama
b4a4eab949
Add drop of db views on migrate fresh command (#812)
* Optionally handle drop of table views on MigrateFresh

@stancl I managed to make the modification discussed here #811 
Afaik (and I can understand) this is the easiest way to handle it, but I'm open to discuss.

* Remove redundant store variable

* code style

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-02-22 16:26:07 +01:00
Samuel Štancl
5b9b384526 Remove codecov 2022-02-19 16:33:59 +01:00
Samuel Štancl
5249ec7c82 ignore changes to queuetest.json 2022-02-19 16:31:45 +01:00
Samuel Štancl
8e9485f9b1 add empty queuetest.json 2022-02-19 16:31:31 +01:00
Samuel Štancl
368d3cc99f add forceRefresh option to QueueTenancyBootstrapper 2022-02-19 16:21:27 +01:00
Samuel Štancl
27f916c323 end tenancy in queue if the next job is not tenant aware 2022-02-19 16:12:38 +01:00
Erik Gaal
9c79267e24
Fix .env loading in development (#799)
* Upgrade vlucas/phpdotenv to ^5.0

`Dotenv::create($paths)` was the syntax for releases before v4

* Remove vlucas/phpdotenv dependency and make it work with newer versions.
2022-02-14 14:31:01 +01:00
Jori Stein
f08e33afd8
Remove redondant initialization (#775) 2022-01-06 21:35:56 +01:00
Samuel Štancl
96d9ad13d8
Add a note about 'tenant' connection being reserved (fixes #774) 2022-01-06 16:57:01 +01:00
Samuel Štancl
e442bdb644 Only use JobRetryRequested in Laravel 8 2021-12-31 18:29:05 +01:00
Samuel Štancl
a83568ded2 Only use JobRetryRequested in Laravel 8 2021-12-31 18:28:37 +01:00
Samuel Štancl
49ef28da05 6.x support 2021-12-31 18:19:53 +01:00
Samuel Štancl
73a4a3018c Improve queue tenancy 2021-12-31 18:10:03 +01:00
Samuel Štancl
5980c46449 wip 2021-12-30 19:46:48 +01:00