generated from MasoniteFramework/starter-package
-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.0' into feature/748-1
- Loading branch information
Showing
104 changed files
with
1,429 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use asdf | ||
layout python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python 3.8.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from src.masoniteorm.connections import ConnectionResolver | ||
|
||
DATABASES = { | ||
"default": "mysql", | ||
"mysql": { | ||
"host": "127.0.0.1", | ||
"driver": "mysql", | ||
"database": "masonite", | ||
"user": "root", | ||
"password": "", | ||
"port": 3306, | ||
"log_queries": False, | ||
"options": { | ||
# | ||
} | ||
}, | ||
"postgres": { | ||
"host": "127.0.0.1", | ||
"driver": "postgres", | ||
"database": "masonite", | ||
"user": "root", | ||
"password": "", | ||
"port": 5432, | ||
"log_queries": False, | ||
"options": { | ||
# | ||
} | ||
}, | ||
"sqlite": { | ||
"driver": "sqlite", | ||
"database": "masonite.sqlite3", | ||
} | ||
} | ||
|
||
DB = ConnectionResolver().set_connection_details(DATABASES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
env = | ||
D:DB_CONFIG_PATH=config/test-database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
flake8==3.7.9 | ||
black | ||
faker | ||
pytest | ||
pytest-cov | ||
pytest-env | ||
pymysql | ||
isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
flake8==3.7.9 | ||
black==19.3b0 | ||
faker | ||
pytest | ||
pytest-cov | ||
pymysql | ||
isort | ||
inflection==0.3.1 | ||
psycopg2-binary | ||
python-dotenv==0.14.0 | ||
pyodbc | ||
pendulum>=2.1,<2.2 | ||
cleo>=0.8.0,<0.9 | ||
cleo>=0.8.0,<0.9 | ||
python-dotenv==0.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from ..migrations import Migration | ||
|
||
from .Command import Command | ||
|
||
|
||
class MigrateFreshCommand(Command): | ||
""" | ||
Drops all tables and migrates them again. | ||
migrate:fresh | ||
{--c|connection=default : The connection you want to run migrations on} | ||
{--d|directory=databases/migrations : The location of the migration directory} | ||
{--f|ignore-fk=? : The connection you want to run migrations on} | ||
{--s|seed=? : Seed database after fresh. The seeder to be ran can be provided in argument} | ||
{--schema=? : Sets the schema to be migrated} | ||
{--D|seed-directory=databases/seeds : The location of the seed directory if seed option is used.} | ||
""" | ||
|
||
def handle(self): | ||
migration = Migration( | ||
command_class=self, | ||
connection=self.option("connection"), | ||
migration_directory=self.option("directory"), | ||
config_path=self.option("config"), | ||
schema=self.option("schema"), | ||
) | ||
|
||
migration.fresh(ignore_fk=self.option("ignore-fk")) | ||
|
||
self.line("") | ||
|
||
if self.option("seed") == "null": | ||
self.call( | ||
"seed:run", | ||
f"None --directory {self.option('seed-directory')} --connection {self.option('connection')}", | ||
) | ||
|
||
elif self.option("seed"): | ||
self.call( | ||
"seed:run", | ||
f"{self.option('seed')} --directory {self.option('seed-directory')} --connection {self.option('connection')}", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
|
||
class BaseConnection: | ||
|
||
_connection = None | ||
_cursor = None | ||
_dry = False | ||
|
Oops, something went wrong.