-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c62f218
commit 3a150b2
Showing
4 changed files
with
44 additions
and
8 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,17 @@ | ||
from cleo import Command | ||
import subprocess | ||
|
||
|
||
class SeedCommand(Command): | ||
""" | ||
Create a seeder to seed a database. | ||
seed | ||
{table : Name of the table to seed} | ||
""" | ||
|
||
def handle(self): | ||
table = self.argument('table').lower() | ||
subprocess.call([ | ||
"orator make:seed {}_table_seeder -p databases/seeds".format(table), | ||
], shell=True) |
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,22 @@ | ||
from cleo import Command | ||
import subprocess | ||
|
||
|
||
class SeedRunCommand(Command): | ||
""" | ||
Create a seeder to seed a database. | ||
seed:run | ||
{table=None : Name of the table to seed} | ||
""" | ||
|
||
def handle(self): | ||
table = self.argument('table').lower() | ||
if not table == 'none': | ||
seeder = '--seeder {}_table_seeder'.format(table.lower()) | ||
else: | ||
seeder = '' | ||
|
||
subprocess.call([ | ||
"orator db:seed -p databases/seeds -c config/database.py -f {}".format(seeder), | ||
], shell=True) |
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