1
shivaji
Want to change table structure of existing table using sql.
  • 2003/11/3 6:46

  • shivaji

  • Friend of XOOPS

  • Posts: 179

  • Since: 2003/9/18


I want to change the table structure of "users" table (want to add a column ) using a sql file (located at sql directory in my mudule directory) during installation of my module. When I try to install my module it's showing some errors that "users table is preserved" and it stop to install my module, but whenever I move the sql query ( which add an column in "users" table) then it's working perfectly, create tables as per my requierments.

Can anybody tell me how can I aviod this restriction.



2
onokazu
Re: Want to change table structure of existing table using sql.
  • 2003/11/3 9:56

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


The core tables are protected so that they are not changed by the modules. Your XOOPS may lose compatiblility with the future versions of XOOPS. There is a way to change the tables during install, using php though. Can you tell me why you need to change the table?

3
shivaji
Re: Want to change table structure of existing table using sql.
  • 2003/11/3 12:57

  • shivaji

  • Friend of XOOPS

  • Posts: 179

  • Since: 2003/9/18


ya it will not work during installation of a new module but if I change the "install\sql\mysql.structure.sql" then
it will work as per my requiermant. Actually I want to add an extra filed in "users" table which will store some information against each user.

4
Mithrandir
Re: Want to change table structure of existing table using sql.

A way to work around this would be to make another table named e.g. [Prefix_MyModule_]users and have a one:one relationship with the [prefix]users table.

On install just take all the uid's from the [prefix]users table and insert into the [Prefix_MyModule_]users table.

Of course this would mean that new registrations will not update the [Prefix_MyModule]users table, but I guess you have some procedure for adding information in that field, so just check to see if the uid is already in the database - if yes, then update, else insert.

5
spajot
Re: Want to change table structure of existing table using sql.
  • 2003/11/10 14:00

  • spajot

  • Just popping in

  • Posts: 2

  • Since: 2003/11/10


Okay, but then, how can man centralize the update of this extra data through the "edit profile" page ?
Is hacking into html\modules\system\admin\users\userform.php the only way to achieve this ?

Sylvain

6
Mithrandir
Re: Want to change table structure of existing table using sql.

Can't see any other way, to be frank - unless you make your own "Edit Extended Profile" page.

Login

Who's Online

458 user(s) are online (305 user(s) are browsing Support Forums)


Members: 0


Guests: 458


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits