From 379f1a8661da46040332923a5ccfb555656b0a8b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 10 Apr 2023 22:53:40 +0300 Subject: Premium users --- src/main/resources/db/migration/V1.46__premium_users.sql | 1 + src/main/resources/schema-h2.sql | 1 + src/main/resources/schema-mysql.sql | 1 + src/main/resources/schema-sqlite.sql | 1 + src/main/resources/schema-sqlserver.sql | 1 + src/main/resources/templates/views/partial/message.html | 2 +- src/main/resources/templates/views/partial/navigation.html | 3 +++ src/main/resources/templates/views/thread.html | 4 ++-- 8 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/db/migration/V1.46__premium_users.sql (limited to 'src/main/resources') diff --git a/src/main/resources/db/migration/V1.46__premium_users.sql b/src/main/resources/db/migration/V1.46__premium_users.sql new file mode 100644 index 00000000..11edb121 --- /dev/null +++ b/src/main/resources/db/migration/V1.46__premium_users.sql @@ -0,0 +1 @@ +alter table users add column premium smallint not null default (0)::smallint; diff --git a/src/main/resources/schema-h2.sql b/src/main/resources/schema-h2.sql index ea979df1..8b786382 100644 --- a/src/main/resources/schema-h2.sql +++ b/src/main/resources/schema-h2.sql @@ -66,6 +66,7 @@ CREATE MEMORY TABLE "PUBLIC"."USERS"( "LASTPM" INTEGER DEFAULT '0' NOT NULL, "LASTPHOTO" INTEGER DEFAULT '0' NOT NULL, "KARMA" SMALLINT DEFAULT '0' NOT NULL, + "PREMIUM" SMALLINT DEFAULT '0' NOT NULL, "LAST_SEEN" TIMESTAMP(6) ); ALTER TABLE "PUBLIC"."USERS" ADD CONSTRAINT "PUBLIC"."CONSTRAINT_4" PRIMARY KEY("ID"); diff --git a/src/main/resources/schema-mysql.sql b/src/main/resources/schema-mysql.sql index e458203f..d0943254 100644 --- a/src/main/resources/schema-mysql.sql +++ b/src/main/resources/schema-mysql.sql @@ -558,6 +558,7 @@ CREATE TABLE `users` ( `lastpm` int(11) NOT NULL DEFAULT 0, `lastphoto` int(11) NOT NULL DEFAULT 0, `karma` smallint(6) NOT NULL DEFAULT 0, + `premium` smallint default '0' not null, `last_seen` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `nick` (`nick`) diff --git a/src/main/resources/schema-sqlite.sql b/src/main/resources/schema-sqlite.sql index 84ad015c..ae1f4317 100644 --- a/src/main/resources/schema-sqlite.sql +++ b/src/main/resources/schema-sqlite.sql @@ -227,6 +227,7 @@ CREATE TABLE users ( lastpm bigint DEFAULT (0) NOT NULL, lastphoto bigint DEFAULT (0) NOT NULL, karma smallint DEFAULT (0) NOT NULL, + premium smallint DEFAULT (0) NOT NULL, last_seen timestamp with time zone, UNIQUE(nick) ); diff --git a/src/main/resources/schema-sqlserver.sql b/src/main/resources/schema-sqlserver.sql index 4a683189..34032b67 100644 --- a/src/main/resources/schema-sqlserver.sql +++ b/src/main/resources/schema-sqlserver.sql @@ -8,6 +8,7 @@ CREATE TABLE users ( lastpm bigint DEFAULT (0) NOT NULL, lastphoto bigint DEFAULT (0) NOT NULL, karma smallint DEFAULT (0) NOT NULL, + premium smallint DEFAULT (0) NOT NULL, last_seen datetimeoffset, UNIQUE(nick), PRIMARY KEY (id) diff --git a/src/main/resources/templates/views/partial/message.html b/src/main/resources/templates/views/partial/message.html index 9d54d614..e9ddd3db 100644 --- a/src/main/resources/templates/views/partial/message.html +++ b/src/main/resources/templates/views/partial/message.html @@ -1,7 +1,7 @@
- {{ msg.user.name }} + {{ msg.user.name }}{% if msg.user.premium %}{% endif %}
{{ msg.user.name }} diff --git a/src/main/resources/templates/views/partial/navigation.html b/src/main/resources/templates/views/partial/navigation.html index 159c3d21..105cc568 100644 --- a/src/main/resources/templates/views/partial/navigation.html +++ b/src/main/resources/templates/views/partial/navigation.html @@ -4,6 +4,9 @@ - {{ msg.user.name }} + {{ msg.user.name }}{% if msg.user.premium %}{% endif %}
{% if msg.FriendsOnly %} @@ -129,7 +129,7 @@