XF 2.2 db vs setup to make the db

briansol

Well-known member
I'm building a custom addon for my site.

I'm at the point where it's hard for me to make the screens i need without the database. chicken/egg problem.

I need the db to make the screens populate and fill dropdowns... but i don't have a database yet because i don't have an app to install. I coded it out in setup.php but i haven't actually run the code.

What's the usual process for building new tables to support development? how do you all approach it?

run it in phpmyadmin?
 
You can manually create the tables which will then allow you to write and run/test the code.

Once you come to actually creating the add-on, the tables would be created as part of the installation routine.
 
in case this helps someone else,

Since i wrote the DDL in a designer (erwin knockoff), i exported the code and converted it to the Setup.php file a while ago. I made some changes since then wihthout the designer (probably not the best workflow) so i didn't want to just run the sql directly.

It was easy to just run the cli to build the database by executing step1 of Setup.php

Code:
C:\xampp\htdocs\xf>php cmd.php xf-addon:install-step MY/addonname 1
Running Setup class method installStep1()... done.
 
Top Bottom