Cakephp How to keep syncing Product database table rows in with dev table rowsTruncating table before seeding in cakephpHow to select the nth row in a SQL database table?How do I quickly rename a MySQL database (change schema name)?How to find all the tables in MySQL with specific column names in them?How do I connect to a MySQL Database in Python?How can I rename a database column in a Ruby on Rails migration?How to get the sizes of the tables of a MySQL database?Populating tables in production with LaravelBest practice for migrate data to production database Rails?Seeding in laravel for multiple databasesKeep code, database structure and database data in sync between revisions
Why didn't NASA launch communications relay satellites for the Apollo missions?
Do pedestrians imitate automotive traffic?
How to create complicated tables (multiple nested columns and rows)
How deep is the Underdark? What is its max and median depth?
She told me that she HAS / HAD a gun
How much did all the space agencies spent on rockets launching and space exploration? What are the benefits for me and you?
Trivial non-dark twist in dark fantasy
3D cursor orientation
Why do we need an estimator to be consistent?
Book in which the "mountain" in the distance was a hole in the flat world
Why are flying carpets banned while flying brooms are not?
Linux ext4 restore file and directory access rights after bad backup/restore
Counting multiples of 3 up to a given number
Why should fork() have been designed to return a file descriptor?
What does Windows' "Tuning up Application Start" do?
why neutral does not shock. how can a neutral be neutral in ac current?
Is art a form of communication?
Making an example from 'Clean Code' more functional
What's a German word for »Sandbagger«?
Three Subway Escalators
Soft constraints and hard constraints
Why can't a country print its own money to spend it only abroad?
Linearize or approximate a square root constraint
ESTA Travel not Authorized. Accepted twice before!
Cakephp How to keep syncing Product database table rows in with dev table rows
Truncating table before seeding in cakephpHow to select the nth row in a SQL database table?How do I quickly rename a MySQL database (change schema name)?How to find all the tables in MySQL with specific column names in them?How do I connect to a MySQL Database in Python?How can I rename a database column in a Ruby on Rails migration?How to get the sizes of the tables of a MySQL database?Populating tables in production with LaravelBest practice for migrate data to production database Rails?Seeding in laravel for multiple databasesKeep code, database structure and database data in sync between revisions
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a table lets call it permissions
I want to keep it in sync from my local dev server with product as easy as possible. In current state, im building new seed file every time (overriding old one) modifying code, to truncate old rows. And insert new ones.
I do know ho migrations and seeds work in cake php. I did read this post
So the flow. i run:
bin/cake bake seed --data Permissions
it generates seed file and overrides old file.
Ten Im adding this modification:
$table = $this->table('permissions');
$table->truncate(); //inserting this line.
$table->insert($data)->save();
then i commit changes, and its get deployed. With seeds being seeded as expected.
Whole process works but is pain every time going this process. Is there is a way I somehow can improve this process? For example somehow changing Seeds default template. As well as attaching all process under git hook.
php mysql migration cakephp-3.0 seeding
add a comment |
I have a table lets call it permissions
I want to keep it in sync from my local dev server with product as easy as possible. In current state, im building new seed file every time (overriding old one) modifying code, to truncate old rows. And insert new ones.
I do know ho migrations and seeds work in cake php. I did read this post
So the flow. i run:
bin/cake bake seed --data Permissions
it generates seed file and overrides old file.
Ten Im adding this modification:
$table = $this->table('permissions');
$table->truncate(); //inserting this line.
$table->insert($data)->save();
then i commit changes, and its get deployed. With seeds being seeded as expected.
Whole process works but is pain every time going this process. Is there is a way I somehow can improve this process? For example somehow changing Seeds default template. As well as attaching all process under git hook.
php mysql migration cakephp-3.0 seeding
add a comment |
I have a table lets call it permissions
I want to keep it in sync from my local dev server with product as easy as possible. In current state, im building new seed file every time (overriding old one) modifying code, to truncate old rows. And insert new ones.
I do know ho migrations and seeds work in cake php. I did read this post
So the flow. i run:
bin/cake bake seed --data Permissions
it generates seed file and overrides old file.
Ten Im adding this modification:
$table = $this->table('permissions');
$table->truncate(); //inserting this line.
$table->insert($data)->save();
then i commit changes, and its get deployed. With seeds being seeded as expected.
Whole process works but is pain every time going this process. Is there is a way I somehow can improve this process? For example somehow changing Seeds default template. As well as attaching all process under git hook.
php mysql migration cakephp-3.0 seeding
I have a table lets call it permissions
I want to keep it in sync from my local dev server with product as easy as possible. In current state, im building new seed file every time (overriding old one) modifying code, to truncate old rows. And insert new ones.
I do know ho migrations and seeds work in cake php. I did read this post
So the flow. i run:
bin/cake bake seed --data Permissions
it generates seed file and overrides old file.
Ten Im adding this modification:
$table = $this->table('permissions');
$table->truncate(); //inserting this line.
$table->insert($data)->save();
then i commit changes, and its get deployed. With seeds being seeded as expected.
Whole process works but is pain every time going this process. Is there is a way I somehow can improve this process? For example somehow changing Seeds default template. As well as attaching all process under git hook.
php mysql migration cakephp-3.0 seeding
php mysql migration cakephp-3.0 seeding
asked Mar 26 at 12:33
Aivaras GodliauskasAivaras Godliauskas
982 silver badges9 bronze badges
982 silver badges9 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55357311%2fcakephp-how-to-keep-syncing-product-database-table-rows-in-with-dev-table-rows%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55357311%2fcakephp-how-to-keep-syncing-product-database-table-rows-in-with-dev-table-rows%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown