Allow lifetime gift code creation in the admin interface

(#3819) Feature Closed: Shipped self-hosting

7 votes Locked

Current problem

Right now, you have to select either days, weeks, months or years when creating gift codes in the admin interface. It doesn't allow to create lifetime gift codes.

Proposed change

Allow the creation of lifetime (visonary) gift codes in the admin interface

Platform

Self-hosting

Additional information

Currently its possible to workaround this: After creating a gift code, you have to edit the data for that code in the db and set duration_quantity to 0.

3 comments

Comment by mesub
mesubMod 1 vote
Status changed from Under consideration to Shipped
This has now been added. Thanks for flying Fluxer!
Comment by Jonah
Jonah 1 vote 1 reply
Could you share how you did that in the database? I accomplished the same thing by changing premium status from 1 to 2 for a user, but I'm not sure that is the most complete way to do this. Your way sounds better, but I couldn't figure it out last night.
Comment by Zoey
Zoey OP2 votes
The SQL command I use is the following: UPDATE public.fluxer_kv SET row_data = row_data || '{"duration_months": 0, "duration_quantity": 0}'::jsonb, updated_at = NOW() WHERE table_name = 'gift_codes' AND row_key = '"ABCDEF"'; ABCDEF is the gift code you created Have my PostgreSQL database hosted on a seperate server and executing the command via pgAdmin. If you use docker it should work with this (UNTESTED): cat << 'EOF' | docker compose exec -T fluxer-postgres-1 psql -U <db_user> -d <db_name> UPDATE public.fluxer_kv SET row_data = row_data || '{"duration_months": 0, "duration_quantity": 0}'::jsonb, updated_at = NOW() WHERE table_name = 'gift_codes' AND row_key = '"ABCDEF"'; EOF