Add column employees.image
This commit is contained in:
parent
80a2f3d70e
commit
35d620f1ab
6 changed files with 9 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
CREATE TABLE employees (
|
||||
id SERIAL PRIMARY KEY,
|
||||
image VARCHAR NOT NULL,
|
||||
name VARCHAR NOT NULL,
|
||||
role VARCHAR NOT NULL
|
||||
);
|
||||
|
@ -34,8 +35,8 @@ CREATE UNIQUE INDEX index_employee_contacts_on_employee_id
|
|||
-- Insert data
|
||||
|
||||
WITH employee_ids AS (
|
||||
INSERT INTO employees (name, role)
|
||||
VALUES ('Alex Kotov', 'Founder')
|
||||
INSERT INTO employees (image, name, role)
|
||||
VALUES ('/kotovalexarian.jpg', 'Alex Kotov', 'Founder')
|
||||
RETURNING id
|
||||
AS employee_id
|
||||
)
|
||||
|
@ -51,8 +52,8 @@ WITH employee_ids AS (
|
|||
'https://fb.com/kotovalexarian');
|
||||
|
||||
WITH employee_ids AS (
|
||||
INSERT INTO employees (name, role)
|
||||
VALUES ('Kirill Goncharov', 'System administrator')
|
||||
INSERT INTO employees (image, name, role)
|
||||
VALUES ('/xuhcc.png', 'Kirill Goncharov', 'System administrator')
|
||||
RETURNING id
|
||||
AS employee_id
|
||||
)
|
||||
|
|
BIN
public/kotovalexarian.jpg
Normal file
BIN
public/kotovalexarian.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
BIN
public/xuhcc.png
Normal file
BIN
public/xuhcc.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
|
@ -9,6 +9,7 @@ use diesel::prelude::*;
|
|||
#[derive(Debug, Identifiable, Serialize, Queryable)]
|
||||
pub struct Employee {
|
||||
pub id: i32,
|
||||
pub image: String,
|
||||
pub name: String,
|
||||
pub role: String,
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ table! {
|
|||
table! {
|
||||
employees (id) {
|
||||
id -> Int4,
|
||||
image -> Varchar,
|
||||
name -> Varchar,
|
||||
role -> Varchar,
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
{{#each employees_with_contacts}}
|
||||
<div class="col-sm-6 col-lg-4">
|
||||
<div class="card mt-4">
|
||||
<img src="{{ this.0.image }}" class="card-img-top"/>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
{{ this.0.name }}
|
||||
|
|
Reference in a new issue