uFlex running on Postgres db. Table structure?

47 views
Skip to first unread message

Baard

unread,
Jun 17, 2013, 6:46:48 AM6/17/13
to uf...@googlegroups.com
Hi there, and thanks for creating a great class.

I´ve used it for a while, and really likes it. However, I am experiencing some issues when setting up the class to use a Postgres database.

How should the user table structure typically be created when using Postgres? Thanks in advance.

Pablo

unread,
Jun 17, 2013, 11:06:10 AM6/17/13
to uf...@googlegroups.com
Im not familiar with PostgreSQL, but if you do convert the table structure to PostgreSQL the class should work as long as you set the correct DB driver for the PDO constructor. For example:

<?php
$user = uFlex(false);
$user->db["user"] = "username";
$user->db["pass"] = "password";
$user->db["dsn"] = "pgsql:host=localhost;dbname=testdb";
$user->start();

Baard

unread,
Jun 18, 2013, 1:42:29 AM6/18/13
to uf...@googlegroups.com
Thanks for your reply. Got the class working using this table structure, using dsn with pgsql prefix.

    Column    |         Type          |                            Modifiers
--------------+-----------------------+-----------------------------------------------------------------
 user_id      | integer               | not null default nextval('users_user_id_seq'::regclass)
 first_name   | character varying(15) |

 last_name    | character varying(15) |
 username     | character varying(15) | not null
 password     | character varying(35) | not null
 email        | character varying(35) | not null
 activated    | smallint              |
default 0
 confirmation | character varying(35) |
 reg_date     | integer               |
default 0
 last_login   | integer               |
default 0
 group_id     | integer               |
default 1
Indexes:
    "users_pkey" PRIMARY KEY, btree (user_id)


I do not know how important the not null modifier would be for the class, but everything seems to work well on my installation.

Best regards,
Baard.
Reply all
Reply to author
Forward
0 new messages