Skip to content

Commit 671ef4d

Browse files
authored
change diesel_manage_updated_at (#16)
1 parent b765d4b commit 671ef4d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

create-rust-app_cli/src/plugins/auth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl Plugin for Auth {
110110
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
111111
);
112112
113-
SELECT diesel_manage_updated_at('users');
113+
SELECT manage_updated_at('users');
114114
115115
CREATE TABLE user_sessions (
116116
id SERIAL PRIMARY KEY,
@@ -121,7 +121,7 @@ impl Plugin for Auth {
121121
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
122122
);
123123
124-
SELECT diesel_manage_updated_at('user_sessions');
124+
SELECT manage_updated_at('user_sessions');
125125
126126
CREATE TABLE user_permissions (
127127
user_id SERIAL NOT NULL REFERENCES users(id),

create-rust-app_cli/template/migrations/00000000000000_diesel_initial_setup/down.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
-- and other internal bookkeeping. This file is safe to edit, any future
33
-- changes will be added to existing projects as new migrations.
44

5-
DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass);
5+
DROP FUNCTION IF EXISTS manage_updated_at(_tbl regclass);
66
DROP FUNCTION IF EXISTS diesel_set_updated_at();

create-rust-app_cli/template/migrations/00000000000000_diesel_initial_setup/up.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
-- ```sql
1515
-- CREATE TABLE users (id SERIAL PRIMARY KEY, updated_at TIMESTAMP NOT NULL DEFAULT NOW());
1616
--
17-
-- SELECT diesel_manage_updated_at('users');
17+
-- SELECT manage_updated_at('users');
1818
-- ```
19-
CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
19+
CREATE OR REPLACE FUNCTION manage_updated_at(_tbl regclass) RETURNS VOID AS $$
2020
BEGIN
2121
EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
2222
FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);

create-rust-app_cli/template/migrations/00000000000002_todos/up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ CREATE TABLE todos (
55
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
66
);
77

8-
SELECT diesel_manage_updated_at('todos');
8+
SELECT manage_updated_at('todos');

0 commit comments

Comments
 (0)