Compare commits

..

No commits in common. "205d3c48e91861ae98b25ace105fd73463c6047e" and "73b24a3a1c303656e93cd9e9203d6da61ce63db5" have entirely different histories.

6 changed files with 4 additions and 9 deletions

View File

@ -5,7 +5,7 @@ authors = ["kirbylife <gabriel13m@gmail.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
rocket = "0.4.11" rocket = "0.4.2"
diesel = { version = "1.0.0", features = ["postgres", "chrono"] } diesel = { version = "1.0.0", features = ["postgres", "chrono"] }
dotenv = "0.9.0" dotenv = "0.9.0"
rand = "0.6.0" rand = "0.6.0"

View File

View File

@ -3,8 +3,6 @@ CREATE TABLE posts (
title VARCHAR NOT NULL, title VARCHAR NOT NULL,
content TEXT NOT NULL, content TEXT NOT NULL,
published BOOLEAN NOT NULL DEFAULT 'f', published BOOLEAN NOT NULL DEFAULT 'f',
views integer NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT NOW(), created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW() updated_at TIMESTAMP NOT NULL DEFAULT NOW()
) )

View File

@ -1,12 +1,10 @@
// @generated automatically by Diesel CLI. table! {
diesel::table! {
posts (id) { posts (id) {
id -> Int4, id -> Integer,
title -> Varchar, title -> Varchar,
content -> Text, content -> Text,
published -> Bool, published -> Bool,
views -> Int4, views -> Integer,
created_at -> Timestamp, created_at -> Timestamp,
updated_at -> Timestamp, updated_at -> Timestamp,
} }

View File

@ -31,7 +31,6 @@
<label for="">Visible</label> <label for="">Visible</label>
<input name="published" type="checkbox" value="true"{% if post.published %}checked{% endif %}/> <input name="published" type="checkbox" value="true"{% if post.published %}checked{% endif %}/>
<textarea id="content" name="content">{{ post.content }}</textarea> <textarea id="content" name="content">{{ post.content }}</textarea>
<input name="views" type="number" value="0" style="display: none"/>
<button>Publicar</button> <button>Publicar</button>
</form> </form>
</div> </div>