数据库篇之[bsp_banners]数据表-网上商城BrnShop1.9升级至2.1升级说明(非官方版本)

简介:

asp.net(c#)网上商城BrnShop1.9升级至2.1升级说明(非官方版本)
主要描述在数据库方面进行升级(使用前请参照网上商城BrnShop1.9升级至2.1升级说明(非官方版本仅提供技术交流)的使用协议)

BrnShop1.9正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 12/09/2014 14:07:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [starttime_endtime_isshow] ON [bsp_banners] 
(
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF


BrnShop2.1正式版本

/****** Object:  Table [dbo].[bsp_banners]    Script Date: 01/13/2015 10:11:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [bsp_banners](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[type] [tinyint] NOT NULL,
	[starttime] [datetime] NOT NULL,
	[endtime] [datetime] NOT NULL,
	[isshow] [tinyint] NOT NULL,
	[title] [nvarchar](100) NOT NULL,
	[img] [nvarchar](250) NOT NULL,
	[url] [nvarchar](250) NOT NULL,
	[displayorder] [int] NOT NULL,
 CONSTRAINT [PK_bsp_banners] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'bannerid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'starttime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'endtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否展示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'isshow'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'img'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'displayorder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'banner表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners'
GO
SET IDENTITY_INSERT [bsp_banners] ON
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (1, 0, CAST(0x0000A35100B595F0 AS DateTime), CAST(0x0000A4D700B595F0 AS DateTime), 1, N'火爆促销', N'fr_1412061404492825858.jpg', N'/', 5)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (4, 0, CAST(0x0000A385017AA854 AS DateTime), CAST(0x0000A4D6017AA854 AS DateTime), 1, N'火爆促销', N'fr_1412061404419541666.jpg', N'/', 6)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (5, 0, CAST(0x0000A3EB0148AB74 AS DateTime), CAST(0x0000A5580148AB74 AS DateTime), 1, N'火爆促销', N'fr_1412061405306289506.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (6, 0, CAST(0x0000A3EB0148CD70 AS DateTime), CAST(0x0000A5540148CD70 AS DateTime), 1, N'火爆促销', N'fr_1412061404554409380.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (7, 1, CAST(0x0000A40700AEA434 AS DateTime), CAST(0x0000A6E400AEA434 AS DateTime), 1, N'特大促销', N'fr_1412201036420464063.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (8, 1, CAST(0x0000A40700AEEF34 AS DateTime), CAST(0x0000A6DD00AEEF34 AS DateTime), 1, N'特大促销', N'fr_1412201037096779867.jpg', N'/', 0)
INSERT [bsp_banners] ([id], [type], [starttime], [endtime], [isshow], [title], [img], [url], [displayorder]) VALUES (9, 1, CAST(0x0000A40700AF0B54 AS DateTime), CAST(0x0000A6E400AF0B54 AS DateTime), 1, N'特大促销', N'fr_1412201037338523694.jpg', N'/', 0)
SET IDENTITY_INSERT [bsp_banners] OFF

其中差异内容如图

差异内容有:

1.有[type]列

2.非聚合索引名称

3.执行增加扩展属性

4.数据插入

更新方法:

ALTER TABLE [bsp_banners]
  ADD [type] [tinyint]
  GO
  UPDATE [bsp_banners]
  SET [type] = 0	-- 默认为PC端
  GO
  ALTER TABLE [bsp_banners]
  ALTER COLUMN [type] [tinyint] NOT NULL	-- 
  GO
  CREATE NONCLUSTERED INDEX [type_starttime_endtime_isshow] ON [bsp_banners] 
(
	[type] ASC,
	[starttime] ASC,
	[endtime] ASC,
	[isshow] DESC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型(0代表PC,1代表手机)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'bsp_banners', @level2type=N'COLUMN',@level2name=N'type'


目录
相关文章
|
7天前
|
存储 Java 数据库连接
时序数据库TDengine 3.3.5.0 发布:高并发支持与增量备份功能引领新升级
TDengine 3.3.5.0 版本正式发布,带来多项更新与优化。新特性包括提升 MQTT 稳定性和高并发性能、新增 taosX 增量备份与恢复、支持 JDBC 和 Rust 连接器 STMT2 接口、灵活配置 Grafana Dashboard 等。性能优化涵盖查询内存管控、多级存储迁移、强密码策略等,全面提升时序数据管理的效率和可靠性。欢迎下载体验并提出宝贵意见。
23 5
|
3月前
|
缓存 数据库 数据安全/隐私保护
Discuz! X 数据库字典详解:DZ各数据表作用及字段含义
我们使用DISCUZ做网站时,有时需要对数据表进行操作,在操作数据表之前,需要对数据表进行了解。下面是DISCUZ 数据库各数据表作用及字段含义详解,方便新手更好的了解DISCUZ数据库。
84 4
|
3月前
|
SQL JSON 关系型数据库
MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
【10月更文挑战第3天】MySQL是一个广泛使用的开源关系型数据库管理系统,它有许多不同的版本
256 5
|
2月前
|
SQL 关系型数据库 数据库连接
"Nacos 2.1.0版本数据库配置写入难题破解攻略:一步步教你排查连接、权限和配置问题,重启服务轻松解决!"
【10月更文挑战第23天】在使用Nacos 2.1.0版本时,可能会遇到无法将配置信息写入数据库的问题。本文将引导你逐步解决这一问题,包括检查数据库连接、用户权限、Nacos配置文件,并提供示例代码和详细步骤。通过这些方法,你可以有效解决配置写入失败的问题。
150 0
|
3月前
|
XML 缓存 数据库
Discuz! X3.0 版本的数据库字典
Discuz! X3.0 版本的数据库字典
70 0
|
3月前
|
JavaScript 前端开发 测试技术
[新手入门]todolist增删改查:vue3+ts版本!
【10月更文挑战第15天】[新手入门]todolist增删改查:vue3+ts版本!
|
3月前
|
监控 关系型数据库 MySQL
如何升级MySQL数据库?
【10月更文挑战第16天】如何升级MySQL数据库?
|
2天前
|
缓存 关系型数据库 MySQL
【深入了解MySQL】优化查询性能与数据库设计的深度总结
本文详细介绍了MySQL查询优化和数据库设计技巧,涵盖基础优化、高级技巧及性能监控。
24 0
|
29天前
|
存储 Oracle 关系型数据库
数据库传奇:MySQL创世之父的两千金My、Maria
《数据库传奇:MySQL创世之父的两千金My、Maria》介绍了MySQL的发展历程及其分支MariaDB。MySQL由Michael Widenius等人于1994年创建,现归Oracle所有,广泛应用于阿里巴巴、腾讯等企业。2009年,Widenius因担心Oracle收购影响MySQL的开源性,创建了MariaDB,提供额外功能和改进。维基百科、Google等已逐步替换为MariaDB,以确保更好的性能和社区支持。掌握MariaDB作为备用方案,对未来发展至关重要。
59 3
|
29天前
|
安全 关系型数据库 MySQL
MySQL崩溃保险箱:探秘Redo/Undo日志确保数据库安全无忧!
《MySQL崩溃保险箱:探秘Redo/Undo日志确保数据库安全无忧!》介绍了MySQL中的三种关键日志:二进制日志(Binary Log)、重做日志(Redo Log)和撤销日志(Undo Log)。这些日志确保了数据库的ACID特性,即原子性、一致性、隔离性和持久性。Redo Log记录数据页的物理修改,保证事务持久性;Undo Log记录事务的逆操作,支持回滚和多版本并发控制(MVCC)。文章还详细对比了InnoDB和MyISAM存储引擎在事务支持、锁定机制、并发性等方面的差异,强调了InnoDB在高并发和事务处理中的优势。通过这些机制,MySQL能够在事务执行、崩溃和恢复过程中保持
71 3