+ Reply to Thread
Results 1 to 4 of 4
This is a discussion on Full Database Schema's for Salesforce - Oralce and MySQL within the Salesforce PHP Tutorials forums, part of the Salesforce category; Well let's continue with the database schema's so you can get more
  1. #1
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16

    Exclamation Full Database Schema's for Salesforce - Oralce and MySQL

    Well let's continue with the database schema's so you can get more ideas of what the structures look like. I am releasing the full MySQL and Oracle database schema's in zip files that are attached to this article

    One problem that needs to be addressed is that the lengths of oracle columns cannot exceed 30 bytes / 30 characters in length. In some cases on the tables you have to make adjustments on some of the column names in order for Oracle to accept the column names.

    An example of a table which needs to have this addressed is the Salesforce.com Profile object / table. If you were to try and create the Profile table with the same field names that come straight from Salesforce, you would receive errors. Let's look at this example:

    Code:
    CREATE TABLE sforce_profile(
    
    Id VARCHAR2 (18),
    Name VARCHAR2 (765),
    PermissionsEditTask CHAR (5),
    PermissionsEditEvent CHAR (5),
    PermissionsManageUsers CHAR (5),
    PermissionsModifyAllData CHAR (5),
    PermissionsCustomizeApplication CHAR (5),
    ……
    The field PermissionsCustomizeApplication would cause an error due to the length being over 30 characters (In Oracle Only). If you do a simple modification to the name of the column such as changing it to:

    Code:
    PermCustomizeApplication CHAR (5),
    See what I did, I removed the missions off of Permissions, and then you will not have any issues. It just makes things that much easier when trying to create tables for your local copy of data. So in the case of the Profile object your table would look something like this:

    Code:
    CREATE TABLE sforce_profile(
    
            Id VARCHAR2 (18),
            Name VARCHAR2 (765),
            PermEditTask CHAR (5),
            PermEditEvent CHAR (5),
            PermManageUsers CHAR (5),
            PermModifyAllData CHAR (5),
            PermManageCases CHAR (5),
            PermEditForecast CHAR (5),
            PermManageSolutions CHAR (5),
            PermCustomizeApplication CHAR (5),
            PermEditReadonlyFields CHAR (5),
            PermRunReports CHAR (5),
            PermViewSetup CHAR (5),
            PermTransferAnyEntity CHAR (5),
            PermManageSelfService CHAR (5),
            PermManageCssUsers CHAR (5),
            PermImportLeads CHAR (5),
            PermManageLeads CHAR (5),
            PermTransferAnyLead CHAR (5),
            PermViewAllData CHAR (5),
            PermEditPublicDocuments CHAR (5),
            PermManageDashboards CHAR (5),
            PermSendSitRequests CHAR (5),
            PermApiUserOnly CHAR (5),
            PermDisableNotifications CHAR (5),
            PermManageCategories CHAR (5),
            PermConvertLeads CHAR (5),
            PermPasswordNeverExpires CHAR (5),
            PermUseTeamReassignWizards CHAR (5),
            PermEditActivatedOrders CHAR (5),
            PermInstallMultiforce CHAR (5),
            PermPublishMultiforce CHAR (5),
            PermEditOppLineItemUnitPrice CHAR (5),
            PermManageTerritories CHAR (5),
            PermCreateMultiforce CHAR (5),
            PermSolutionImport CHAR (5),
            PermManageCallCenters CHAR (5),
            PermEditReports CHAR (5),
            CreatedDate DATE,
            CreatedById VARCHAR2 (18),
            LastModifiedDate DATE,
            LastModifiedById VARCHAR2 (18),
            SystemModstamp DATE,
            Description VARCHAR2 (765)
        );
    So in closing you can view the two attachments to this article. They are full working schema's for Oracle and MySQL. Please keep in mind that these schema's were built off of a developers account. You may have custom fields that you will need to define and they end with "__c". If you have any questions please do not hesitate to contact me

    ~Mike
    Attached Files Attached Files
    Last edited by mike; 07-10-2007 at 07:15 AM. Reason: Made Small Corrections

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16

    MySQL DATE change

    One thing that you can do to MySQL is change the data type on Salesforce DATE fields, example:

    Account Object:
    CreatedDate column/field. I orginally setup this field as a DATE type, but you can change it to DATETIME. When you change the type, you will see a difference in your data in MySQL:

    Code:
    DATE type:
    2007-07-10
    `createddate` date default NULL,
    Code:
    DATETIME type:
    2007-07-10 12:49:40
    `createddate` datetime default NULL,

    You can do this to any date field in MySQL

  3. #3
    pankajshukla2282 is offline Junior Member
    Join Date
    Nov 2008
    Posts
    2

    Wanted Info: Full Database Schema's for Salesforce - Oralce and MySQL

    Hello Mike,

    I would like to know about differences among salesforce's current database schema and schema that you have attached with this post (about no. of tables, fields, datatypes etc).

    Also I want to know exporting salesforce data to MS Access or directly to mysql format

    I want it for MySql.

    I will be thankful to you if you provide me these informations.

    Thank you Mike

  4. #4
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    607
    Blog Entries
    16
    Quote Originally Posted by pankajshukla2282 View Post
    Hello Mike,

    I would like to know about differences among salesforce's current database schema and schema that you have attached with this post (about no. of tables, fields, datatypes etc).

    Also I want to know exporting salesforce data to MS Access or directly to mysql format

    I want it for MySql.

    I will be thankful to you if you provide me these informations.

    Thank you Mike
    This is a schema that was created by an old tool that I had installed on a localhost awhile back

    I have a new tool that will create a mysql schema for your organizations Salesforce instance. It uses the describeObject and describeField to create the data types for MySQL.

    You can view and use that tool by going to Salesforce MySQL Schema Build Tool

    Once you submit the form, it will connect to salesforce, loop through all your objects and then you can download your schema





    ~Mike

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2