Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database conector MSSQL #855

Closed
genthalili opened this issue Mar 27, 2018 · 2 comments
Closed

Database conector MSSQL #855

genthalili opened this issue Mar 27, 2018 · 2 comments
Assignees

Comments

@genthalili
Copy link

Node.js version:
v9.9.0
npm version:
5.8.0
Strapi version:
strapi@3.0.0-alpha.11.1
Operating system:
ProductName: Mac OS X
ProductVersion: 10.13.3

Do you want to request a feature or report a bug?

What is the current behavior?
It there a way to connect strapi with Microsoft SQL Server database? If yes, can anyone share information how can I quickstart?

@lauriejim lauriejim changed the title database conector MSSQL Database conector MSSQL Mar 27, 2018
@piere129
Copy link

I did it using the following in MySQL:

  1. create strapi app with MySQL database and specify db config when asked (database name, port, ...)
  2. create a content type (f.e. : 'product') which contains a field (f.e. : a string called 'name');
  3. As Strapi is currently configured, you MUST create the table for your new content-type yourself. There are a few things to keep in mind for this:
  • creating a table should include created_at and updated_at fields, as those are included by default
  • it needs an auto-incremented id field
  • the names of the fields must be the same as the ones you entered in the admin ui (so a string called 'name')
  • the name of the table, should be the same as the collectionName specified at api/product/models/product.settings
  1. After creating your table, go to admin ui again, ensure you are connected with the database, and try creating a new product. It should now be working.

This is how i got it to work for me. Hope it helps

@wcorrea
Copy link

wcorrea commented Mar 30, 2018

Also, for MySQL,
use lowercase letters only for columns names
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
to avoid problems with updated_at and created_at columns when getting populated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants