1

Recently my database got deleted due to some issues.I am using codeigniter for my project is there any way I can get the structure of my database from codeigniter source code.any help will be appreciated

1
  • If you have used migration class, you can recreate your database. Commented Mar 31, 2017 at 16:35

1 Answer 1

1

Sorry to say but no. At least not entirely and it won't be easy. But you can extract some information that might help.

You can examine all the model files and learn what table names are used. You might also find the names of some fields. That won't tell you directly everything you need to know about the fields. But you might be able to figure out the data types.

You can also examine how the data returned from models is used in controllers and views. That might help you get a handle on data types. That might also be helpful in cases where the query is a Select * which provides no info on how many fields exist or what the names are.

Unless your application was very simple you have a long road ahead.

Let this be a lesson - Backup your projects including the database!

Sign up to request clarification or add additional context in comments.

1 Comment

Totally agree with the answer. Also one can backup their databases by using Database Forge class provided by CodeIgniter. But this is the way of prevention.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.