I have a table in my SQLite database which I need to use as a Template. When the user needs to create a new entry, this template should be displayed. However, the data that is entered should be stored in a table which should ideally have the same structure and keys as the template table. for this to be done, I need to create a new table in the database first which has the same structure, primary key and foreign keys as in the template table. The methods I have tried till now help in creating a new table with the same structure but does not reflect foreign keys as in the original table. How can I do this?
PS: I don't want to use sqlite_master to fetch the table scheme as I will be changing the database later.
Although, other posts suggest the use of 'as select' command, it does copy the table structure alone but fails to include key constraints.