<div dir="ltr"><div>Hi all,</div><div><br></div><div>After spending the last 12 months working intensively on a PHP based project, I moved back to FPC once again for another project. One of the more interesting concepts working in PHP was migrations. These are simple scripts that define the columns in a database table including indexes and foreign key constraints. Next to that also seeding and factories are integrated in this design. A trivial example is shown below; <br></div><div><pre class="gmail-language-php"><code class="gmail-language-php"><span class="gmail-token gmail-php gmail-language-php"> Schema<span class="gmail-token gmail-punctuation">:</span><span class="gmail-token gmail-punctuation">:</span><span class="gmail-token gmail-function">create</span><span class="gmail-token gmail-punctuation">(</span><span class="gmail-token gmail-single-quoted-string gmail-string">'flights'</span><span class="gmail-token gmail-punctuation">,</span> <span class="gmail-token gmail-keyword">function</span> <span class="gmail-token gmail-punctuation">(</span>Blueprint <span class="gmail-token gmail-variable">$table</span><span class="gmail-token gmail-punctuation">)</span> <span class="gmail-token gmail-punctuation">{</span>
<span class="gmail-token gmail-variable">$table</span><span class="gmail-token gmail-operator">-</span><span class="gmail-token gmail-operator">></span><span class="gmail-token gmail-function">id</span><span class="gmail-token gmail-punctuation">(</span><span class="gmail-token gmail-punctuation">)</span><span class="gmail-token gmail-punctuation">;</span>
<span class="gmail-token gmail-variable">$table</span><span class="gmail-token gmail-operator">-</span><span class="gmail-token gmail-operator">></span><span class="gmail-token gmail-function">string</span><span class="gmail-token gmail-punctuation">(</span><span class="gmail-token gmail-single-quoted-string gmail-string">'name'</span><span class="gmail-token gmail-punctuation">)</span><span class="gmail-token gmail-punctuation">;</span>
<span class="gmail-token gmail-variable">$table</span><span class="gmail-token gmail-operator">-</span><span class="gmail-token gmail-operator">></span><span class="gmail-token gmail-function">string</span><span class="gmail-token gmail-punctuation">(</span><span class="gmail-token gmail-single-quoted-string gmail-string">'airline'</span><span class="gmail-token gmail-punctuation">)</span><span class="gmail-token gmail-punctuation">;</span>
<span class="gmail-token gmail-variable">$table</span><span class="gmail-token gmail-operator">-</span><span class="gmail-token gmail-operator">></span><span class="gmail-token gmail-function">timestamps</span><span class="gmail-token gmail-punctuation">(</span><span class="gmail-token gmail-punctuation">)</span><span class="gmail-token gmail-punctuation">;</span>
<span class="gmail-token gmail-punctuation">}</span><span class="gmail-token gmail-punctuation">)</span><span class="gmail-token gmail-punctuation">;</span></span></code></pre></div><div>I already did some tests in pascal and it seems quite doable to create a system like this. But before I proceed I would like to check here if something like this already exists and if other developers are interested in this. If so I would publish the sources on github.</div><div><br></div><div>Rgds, Darius<br></div></div>