-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheroku.session.sql
More file actions
77 lines (59 loc) · 1.91 KB
/
heroku.session.sql
File metadata and controls
77 lines (59 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
-- CRUD TABLES
--@block
CREATE TABLE user_auth (
email VARCHAR(100) PRIMARY KEY,
hashed_password varchar(255)
);
--@block
SELECT *
FROM pg_catalog.pg_tables
WHERE schemaname != 'pg_catalog' AND
schemaname != 'information_schema';
--@block
SELECT
table_name,
column_name,
data_type
FROM
information_schema.columns
WHERE
table_name = 'profiles';
--@block
ALTER TABLE profiles
ADD galleryTitle varchar(255);
--@block
DROP TABLE profiles;
-- CRUD ROWS
--@block
INSERT INTO profiles (fltr, imgSrc, title, summary, galleryHref, galleryTitle)
VALUES
('filter-app', 'assets/img/portfolio/portfolio-1.jpg', 'App 1', 'App', 'assets/img/portfolio/portfolio-1.jpg', 'App 1')
RETURNING id ;
--@block
SELECT * FROM profiles;
--@block
UPDATE profiles
SET
imgsrc = 'https://images.unsplash.com/photo-1589365278144-c9e705f843ba?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Ym90dGxlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60',
GalleryHref= 'https://images.unsplash.com/photo-1589365278144-c9e705f843ba?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Ym90dGxlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60'
WHERE id = 4;
--@block
DELETE FROM profiles WHERE id=1;
-- CRUD ROWS FOR USER AUTH
--@block
INSERT INTO user_auth (email, hashed_password)
VALUES
('admin@admin.com', 'string')
RETURNING email;
--@block
SELECT * FROM user_auth;
--@block
SELECT hashed_password FROM user_auth WHERE email='admin@admin.com';
--@block
UPDATE profiles
SET
imgsrc = 'https://images.unsplash.com/photo-1589365278144-c9e705f843ba?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Ym90dGxlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60',
GalleryHref= 'https://images.unsplash.com/photo-1589365278144-c9e705f843ba?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8Ym90dGxlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60'
WHERE id = 4;
--@block
DELETE FROM user_auth WHERE true;