Skip to content

Commit 0bb6180

Browse files
committed
Move DIFF button and output upper
because it's hard to find the output when it's appended to the bottom of the page.
1 parent e00fb64 commit 0bb6180

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

index.html

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
background: #eee;
2121
color: #000;
2222
padding: 20px;
23-
margin-bottom: 20px;
2423
width: 100%;
2524
}
2625
pre {
@@ -38,39 +37,48 @@
3837
a:hover {
3938
color: IndianRed;
4039
}
40+
h4.schema-header {
41+
margin-bottom: 0.7em;
42+
}
4143
</style>
4244
</head>
4345
<body>
4446
<h1>sqldef</h1>
4547
<img src="https://github.com/k0kubun/sqldef/raw/master/demo.gif" alt="screen capture" />
48+
4649
<h2>What is it?</h2>
4750
<p>sqldef is a <a href="https://github.com/k0kubun/sqldef">CLI tool</a>, <a href="https://github.com/sqldef/sqldef.github.io">webasm library</a>, and <a href="https://github.com/sqldef/node-sqldef">nodejs tool/library</a> for diffing SQL schema. You can use it to manage migration of PostgreSQL and MySQL databases, using regular SQL DDL.</p>
51+
4852
<h2>Demo</h2>
49-
<p>You can diff these 2 schemas:</p>
50-
<pre id="error"></pre>
53+
<p>You can generate DDLs to update the DB schema:</p>
54+
55+
<div>
56+
<select id="dbType">
57+
<option value="mysql">MySQL</option>
58+
<option value="postgres">PostgreSQL</option>
59+
</select>
60+
<button id="buttonDiff">DIFF</button>
61+
</div>
62+
63+
<pre id="output"></pre>
64+
<pre id="error"></pre>
65+
66+
<h4 class="schema-header">Current schema</h4>
5167
<textarea id="inputA" rows="10">
5268
CREATE TABLE user (
5369
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
5470
name VARCHAR(128) DEFAULT 'konsumer'
5571
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;
5672
</textarea>
5773

74+
<h4 class="schema-header">New schema</h4>
5875
<textarea id="inputB" rows="10">
5976
CREATE TABLE user (
6077
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
6178
name VARCHAR(128) DEFAULT 'konsumer',
6279
created_at DATETIME NOT NULL
6380
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;
6481
</textarea>
65-
<div>
66-
<select id="dbType">
67-
<option value="mysql">MySQL</option>
68-
<option value="postgres">PostgreSQL</option>
69-
</select>
70-
<button id="buttonDiff">DIFF</button>
71-
</div>
72-
<pre id="output"></pre>
73-
</body>
7482

7583
<script>
7684
const button = document.getElementById('buttonDiff')
@@ -93,4 +101,5 @@ <h2>Demo</h2>
93101
})
94102
</script>
95103

96-
</html>
104+
</body>
105+
</html>

0 commit comments

Comments
 (0)