Skip to content

Commit 1488be7

Browse files
committed
use patch for DB changes
1 parent ca55a2f commit 1488be7

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Diff for: qiita_db/support_files/patches/93.sql

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- Jun 19, 2024
2+
-- Adding a new column to the user table that logs when this account was created
3+
-- Usefull e.g. to prune non-verified=inactive user or to plot user growth
4+
5+
ALTER TABLE qiita.qiita_user
6+
ADD creation_timestamp timestamp without time zone DEFAULT NOW();
7+
8+
COMMENT ON COLUMN qiita.qiita_user.creation_timestamp IS 'The date the user account was created';

Diff for: qiita_db/support_files/qiita-db-unpatched.sql

+1-2
Original file line numberDiff line numberDiff line change
@@ -1891,8 +1891,7 @@ CREATE TABLE qiita.qiita_user (
18911891
receive_processing_job_emails boolean DEFAULT false,
18921892
social_orcid character varying DEFAULT NULL,
18931893
social_researchgate character varying DEFAULT NULL,
1894-
social_googlescholar character varying DEFAULT NULL,
1895-
creation_timestamp timestamp without time zone DEFAULT NULL
1894+
social_googlescholar character varying DEFAULT NULL
18961895
);
18971896

18981897

Diff for: qiita_db/user.py

-6
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,6 @@ def create(cls, email, password, info=None):
234234
cls._table, ','.join(columns), ','.join(['%s'] * len(values)))
235235
qdb.sql_connection.TRN.add(sql, values)
236236

237-
# log timestamp of user creation
238-
sql = """UPDATE qiita.{0}
239-
SET creation_timestamp = NOW()
240-
WHERE email = %s""".format(cls._table)
241-
qdb.sql_connection.perform_as_transaction(sql, [email])
242-
243237
# Add system messages to user
244238
sql = """INSERT INTO qiita.message_user (email, message_id)
245239
SELECT %s, message_id FROM qiita.message

0 commit comments

Comments
 (0)