After several installs of uCommerce I like to come up with a suggestion:
What about installing uCommerce without any demo data (no catalogs, no products, no orders etc) and moving all these things into the uCommerce demo store package? This would give us a plain and empty uCommerce base, no need to clean SQL tables by hand or to delete records using the backend (which only results in setting hidden flags). If someone wants something to play with, the demo store is only a few clicks away. ;)
That is a very good Idea. In that way you will get a clean solution and no dependancies on data. It is a mission to get rid of the test data because of the dependancies of the data that are linked to eac other. I did multiple installs of uCommerce and that is one of the problems I came across with the test data!!
I have been thinking about this one too, and i agree that i would be nice to have a "clean start" for uCommerce projects. I had the same issue some weeks ago where i wanted to get rid of especially the test-orders. I came up with this homemade SQL script to clear the default uCommerce-database:
delete from uCommerce_ProductCatalogGroupShippingMethodMap delete from uCommerce_ShippingMethodPaymentMethods delete from uCommerce_ShippingMethodPrice delete from uCommerce_ShippingMethodDescription delete from uCommerce_ShippingMethodCountry delete from uCommerce_OrderLine delete from uCommerce_Shipment delete from uCommerce_ShippingMethod delete from uCommerce_ProductCatalogGroupPaymentMethodMap delete from uCommerce_PaymentProperty delete from uCommerce_PaymentMethodFee delete from uCommerce_PaymentMethodDescription delete from uCommerce_PaymentMethodCountry delete from uCommerce_Payment delete from uCommerce_PaymentMethod delete from uCommerce_CategoryProductRelation delete from uCommerce_ProductDescriptionProperty delete from uCommerce_ProductDescription delete from uCommerce_ProductProperty delete from uCommerce_PriceGroupPrice delete from uCommerce_Product delete from uCommerce_ProductCatalogDescription delete from uCommerce_product delete from uCommerce_CategoryProductRelation delete from uCommerce_CategoryProperty delete from uCommerce_CategoryDescription delete from uCommerce_Category delete from uCommerce_ProductCatalog delete from uCommerce_Address delete from uCommerce_OrderStatusAudit update uCommerce_PurchaseOrder set BillingAddressId = null delete from uCommerce_OrderAddress delete from uCommerce_PurchaseOrder delete from uCommerce_ProductCatalogGroup delete from uCommerce_Country delete from uCommerce_PriceGroup delete from uCommerce_Currency delete from uCommerce_Customer delete from uCommerce_DataTypeEnumDescription delete from uCommerce_DataTypeEnum delete from uCommerce_ProductDefinitionFieldDescription delete from uCommerce_ProductDefinitionField delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'License' delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'SupportCoupons' delete from uCommerce_ProductDefinition delete from uCommerce_DefinitionFieldDescription delete from uCommerce_DefinitionField delete from uCommerce_Definition where uCommerce_Definition.DefinitionTypeId = '1' delete from uCommerce_EmailContent delete from uCommerce_EmailType delete from uCommerce_EmailContent delete from uCommerce_EmailProfileInformation delete from uCommerce_EmailProfile
As you write, Luyolo, the dependencies in the database makes it quite difficult to delete the records, but after a lot of "trial and error" i think the order of the delete-statements above will clear the default database. I would rather have truncated the tables to initialize the primary key ID's again, but i cannot get it to work. Maybe Søren is holding the key here? :-)
To avoid the above SQL-script i also think that it would be nice to have a clean uCommerce-install and then put the test-definitions, test-products and test-orders in a separate package or script.
uCommerce core package with clean database?
After several installs of uCommerce I like to come up with a suggestion:
What about installing uCommerce without any demo data (no catalogs, no products, no orders etc) and moving all these things into the uCommerce demo store package? This would give us a plain and empty uCommerce base, no need to clean SQL tables by hand or to delete records using the backend (which only results in setting hidden flags). If someone wants something to play with, the demo store is only a few clicks away. ;)
What do you think? Good idea? Bad idea? Why?
Hi Christian,
That is a very good Idea. In that way you will get a clean solution and no dependancies on data. It is a mission to get rid of the test data because of the dependancies of the data that are linked to eac other. I did multiple installs of uCommerce and that is one of the problems I came across with the test data!!
Thanks for your reply, Luyolo. It's time to ask the boss: Søren, what do you think? :)
Hi Christian and Luyolo
I have been thinking about this one too, and i agree that i would be nice to have a "clean start" for uCommerce projects. I had the same issue some weeks ago where i wanted to get rid of especially the test-orders. I came up with this homemade SQL script to clear the default uCommerce-database:
delete from uCommerce_ProductCatalogGroupShippingMethodMap
delete from uCommerce_ShippingMethodPaymentMethods
delete from uCommerce_ShippingMethodPrice
delete from uCommerce_ShippingMethodDescription
delete from uCommerce_ShippingMethodCountry
delete from uCommerce_OrderLine
delete from uCommerce_Shipment
delete from uCommerce_ShippingMethod
delete from uCommerce_ProductCatalogGroupPaymentMethodMap
delete from uCommerce_PaymentProperty
delete from uCommerce_PaymentMethodFee
delete from uCommerce_PaymentMethodDescription
delete from uCommerce_PaymentMethodCountry
delete from uCommerce_Payment
delete from uCommerce_PaymentMethod
delete from uCommerce_CategoryProductRelation
delete from uCommerce_ProductDescriptionProperty
delete from uCommerce_ProductDescription
delete from uCommerce_ProductProperty
delete from uCommerce_PriceGroupPrice
delete from uCommerce_Product
delete from uCommerce_ProductCatalogDescription
delete from uCommerce_product
delete from uCommerce_CategoryProductRelation
delete from uCommerce_CategoryProperty
delete from uCommerce_CategoryDescription
delete from uCommerce_Category
delete from uCommerce_ProductCatalog
delete from uCommerce_Address
delete from uCommerce_OrderStatusAudit
update uCommerce_PurchaseOrder set BillingAddressId = null
delete from uCommerce_OrderAddress
delete from uCommerce_PurchaseOrder
delete from uCommerce_ProductCatalogGroup
delete from uCommerce_Country
delete from uCommerce_PriceGroup
delete from uCommerce_Currency
delete from uCommerce_Customer
delete from uCommerce_DataTypeEnumDescription
delete from uCommerce_DataTypeEnum
delete from uCommerce_ProductDefinitionFieldDescription
delete from uCommerce_ProductDefinitionField
delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'License'
delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'SupportCoupons'
delete from uCommerce_ProductDefinition
delete from uCommerce_DefinitionFieldDescription
delete from uCommerce_DefinitionField
delete from uCommerce_Definition where uCommerce_Definition.DefinitionTypeId = '1'
delete from uCommerce_EmailContent
delete from uCommerce_EmailType
delete from uCommerce_EmailContent
delete from uCommerce_EmailProfileInformation
delete from uCommerce_EmailProfile
As you write, Luyolo, the dependencies in the database makes it quite difficult to delete the records, but after a lot of "trial and error" i think the order of the delete-statements above will clear the default database. I would rather have truncated the tables to initialize the primary key ID's again, but i cannot get it to work. Maybe Søren is holding the key here? :-)
To avoid the above SQL-script i also think that it would be nice to have a clean uCommerce-install and then put the test-definitions, test-products and test-orders in a separate package or script.
Regards
Anders
This is awesome! Thanks for sharing, Anders!
Bye
Christian
Here's an updated version of Anders' script:
delete from uCommerce_ProductCatalogGroupShippingMethodMap
delete from uCommerce_ShippingMethodPaymentMethods
delete from uCommerce_ShippingMethodPrice
delete from uCommerce_ShippingMethodDescription
delete from uCommerce_ShippingMethodCountry
delete from uCommerce_OrderLine
delete from uCommerce_Shipment
delete from uCommerce_ShippingMethod
delete from uCommerce_ProductCatalogGroupPaymentMethodMap
delete from uCommerce_PaymentProperty
delete from uCommerce_PaymentMethodFee
delete from uCommerce_PaymentMethodDescription
delete from uCommerce_PaymentMethodCountry
delete from uCommerce_Payment
delete from uCommerce_PaymentMethod
delete from uCommerce_CategoryProductRelation
delete from uCommerce_ProductDescriptionProperty
delete from uCommerce_ProductDescription
delete from uCommerce_ProductProperty
delete from uCommerce_PriceGroupPrice
delete from uCommerce_Product
delete from uCommerce_ProductCatalogDescription
delete from uCommerce_product
delete from uCommerce_CategoryProductRelation
delete from uCommerce_CategoryProperty
delete from uCommerce_CategoryDescription
delete from uCommerce_Category
delete from uCommerce_ProductCatalogPriceGroupRelation
delete from uCommerce_Permission
delete from uCommerce_Role
delete from uCommerce_ProductCatalog
delete from uCommerce_Address
delete from uCommerce_OrderStatusAudit
update uCommerce_PurchaseOrder set BillingAddressId = null
delete from uCommerce_OrderAddress
delete from uCommerce_PurchaseOrder
delete from uCommerce_ProductCatalogGroup
delete from uCommerce_Country
delete from uCommerce_PriceGroup
delete from uCommerce_Currency
delete from uCommerce_Customer
delete from uCommerce_DataTypeEnumDescription
delete from uCommerce_DataTypeEnum
delete from uCommerce_ProductDefinitionFieldDescription
delete from uCommerce_ProductDefinitionField
delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'License'
delete from uCommerce_DataType where uCommerce_DataType.TypeName = 'SupportCoupons'
delete from uCommerce_ProductDefinition
delete from uCommerce_DefinitionFieldDescription
delete from uCommerce_DefinitionField
delete from uCommerce_Definition where uCommerce_Definition.DefinitionTypeId = '1'
delete from uCommerce_EmailContent
delete from uCommerce_EmailType
delete from uCommerce_EmailContent
delete from uCommerce_EmailProfileInformation
delete from uCommerce_EmailProfile
is working on a reply...