snipt

Ctrl+h for KB shortcuts

MySQL

cakephp initial posts table

1
2
3
4
5
6
7
8
CREATE TABLE posts (
    id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    user_id INT(11) NOT NULL,
    title VARCHAR(255) NOT NULL,
    body TEXT,
    created DATETIME,
    modified DATETIME
);
https://snipt.net/embed/8dff735da5c8b06432139817b2526905/
/raw/8dff735da5c8b06432139817b2526905/
8dff735da5c8b06432139817b2526905
mysql
MySQL
8
2019-07-10T11:25:40
True
False
False
/api/public/snipt/4856/
cakephp-initial-posts-table
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="nf">posts</span> <span class="p">(</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">id</span> <span class="kt">INT</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span> <span class="kp">AUTO_INCREMENT</span> <span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">,</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">user_id</span> <span class="kt">INT</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span><span class="p">,</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">title</span> <span class="kt">VARCHAR</span><span class="p">(</span><span class="mi">255</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span><span class="p">,</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">body</span> <span class="kt">TEXT</span><span class="p">,</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">created</span> <span class="kt">DATETIME</span><span class="p">,</span> </span><span id="L-7"><a name="L-7"></a> <span class="n">modified</span> <span class="kt">DATETIME</span> </span><span id="L-8"><a name="L-8"></a><span class="p">);</span> </span></pre></div> </td></tr></table>
cakephp, mysql

MySQL

cake php initial user table

1
2
3
4
5
6
7
CREATE TABLE users (
    id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(255) NOT NULL UNIQUE,
    password CHAR(40) NOT NULL,
    created DATETIME,
    modified DATETIME
);
https://snipt.net/embed/0031b7849ca9765b9fe02bf534343efc/
/raw/0031b7849ca9765b9fe02bf534343efc/
0031b7849ca9765b9fe02bf534343efc
mysql
MySQL
7
2019-07-18T12:12:44
True
False
False
/api/public/snipt/4855/
cake-php-initial-user-table
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="nf">users</span> <span class="p">(</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">id</span> <span class="kt">INT</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span> <span class="kp">AUTO_INCREMENT</span> <span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">,</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">username</span> <span class="kt">VARCHAR</span><span class="p">(</span><span class="mi">255</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span> <span class="k">UNIQUE</span><span class="p">,</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">password</span> <span class="kt">CHAR</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span><span class="p">,</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">created</span> <span class="kt">DATETIME</span><span class="p">,</span> </span><span id="L-6"><a name="L-6"></a> <span class="n">modified</span> <span class="kt">DATETIME</span> </span><span id="L-7"><a name="L-7"></a><span class="p">);</span> </span></pre></div> </td></tr></table>
cakephp, mysql